A library that provides a Map component that uses Google Maps on Android and Apple Maps or Google Maps on iOS.
This library is listed in the Expo SDK reference because it is included in
Expo Go
. You may use any library of your choice with
development builds
.
react-native-maps
provides a Map component that uses Google Maps on Android and Apple Maps or Google Maps on iOS.
No additional setup is required when testing your project using Expo Go. However,
to deploy the app binary on app stores
additional steps are required for Google Maps. For more information, see the
instructions below
.
If you have already registered a project for another Google service on Android, such as Google Sign In, you enable the Maps SDK for Android on your project and jump to step 4.
If you are deploying your app to the Google Play Store, you'll need to upload your app binary to Google Play console at least once. This is required for Google to generate your app signing credentials.
Go to the Google Play Console > (your app) > Release > Setup > App integrity > App Signing.
Copy the value of SHA-1 certificate fingerprint.
If you have already created a development build, your project will be signed using a debug keystore.
After the build is complete, go to your project's dashboard, then, under Configure > click Credentials.
Under Application Identifiers, click your project's package name and under Android Keystore copy the value of SHA-1 Certificate Fingerprint.
Copy your API Key into your app.json under the android.config.googleMaps.apiKey field.
In your code, import { PROVIDER_GOOGLE } from react-native-maps and add the property provider=PROVIDER_GOOGLE to your <MapView>. This property works on both Android and iOS.
Rebuild the app binary (or re-submit to the Google Play Store in case your app is already uploaded). An easy way to test if the configuration was successful is to do an emulator build.
If you have already registered a project for another Google service on iOS, such as Google Sign In, you enable the Maps SDK for iOS on your project and jump to step 3.