- From your Google Cloud Platform add the Places and Maps SDK to your project.
- Places & Geocoding API Key.
- DEV:
- Click APIs & Services on the left menu
- Click “Credentials”
- Click “Create Credentials” on top of the screen
- Choose “API key”.
- Add a name to identify that Api key (eg. Places Api Key dev).
- In “Application Restrictions” choose IP addresses and restrict it to the ip address(es) of your development machine(s).
- In the API restrictions section, choose Places API and Geocoding API. You have successfully added a development api key for Places and Geocoding apis.
- Release: Repeat the same procedure to the previous step two more times (one for each platform) with the following change in steps
- Android
- In ‘Application Restrictions’ choose ‘Android Apps’
- in ‘Restrict usage to your Android apps’ section click “ADD AN ITEM” and fill in your app’s package name along with the SHA-1 certificate fingerprint. Follow on page instructions on how to generate your ‘Release certificate fingerprint’.
- iOS
- In ‘Application Restrictions’ choose ‘iOSApps’.
- In ‘Accept requests from an iOS application with one of these bundle identifiers’, click “ADD AN ITEM” and type your iOS app’s bundle identifier. Ideally you should use the same name for ios and android.
- Android
- Open your project and add the above generated keys in the relevent placeholders inside ‘.env.development’ and ‘.env.production’ files.
- DEV:
- Google Maps API Key Android.
- Click APIs & Services on the left menu -> Click “Credentials” -> Click “Create Credentials” on top of the screen -> Choose “API key”.
- Add a name to identify that Api key (eg. Google maps Android Api key).
- In “Application Restrictions” choose “Android Apps”.
- In “Restrict usage to your Android Apps”, click to add an item and add your package name and the SHA-1 fingerprint of your development machine (Debug certificate fingerprint).
- In “Api Restrictions” choose Maps SDK for Android.
- Click Save.
- Repeat the above steps to add a production Maps Api Key.
- Inside your project, open AndroidManifest.xml and depending on the environment you want to build and run your application (development or production) replace with the respective api key from above<meta-dataandroid:name=”com.google.android.geo.API_KEY”android:value=”DEVELOPMENT_OR_PRODUCTION_API_KEY”/>