This plugin is built only by create native page
UIViewController
for iOS orActivity
for Android. and present the page in front of React Native Application without any special dependencies just native code
npm install react-native-place-picker
# or
yarn add react-native-place-picker
expo-dev-client
and run expo run:ios
or expo run:android
Info Expo managed app not yet supported 🚧
Info.plist
<key>NSLocationWhenInUseUsageDescription</key>
<string>YOUR_PURPOSE_HERE</string>
AndroidManifest.xml
you Google Map API Key or your application will crash<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_KEY" />
import { pickPlace } from 'react-native-place-picker';
pickPlace({
enableUserLocation: true,
enableGeocoding: true,
color: '#FF00FF',
//...etc
})
.then(console.log)
.catch(console.log);
// or
pickPlace().then(console.log).catch(console.log);
{
/**
* @description Selected coordinate.
*/
coordinate: PlacePickerCoordinate;
/**
* @description Geocoded address for selected location.
* @if `enableGeocoding: true`
*/
address?: PlacePickerAddress;
/**
* @description Did cancel the place picker window without selecting.
*/
didCancel: boolean;
}
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Generated using TypeDoc