1. Generate API Key #
- Visit: Google Cloud Console
- Create a project or select your existing one.
- Go to APIs & Services > Credentials.
- Click Create Credentials > API Key.
- Enable required APIs:
Required APIs: #
- Maps SDK for Android
- Maps SDK for iOS
- Maps JavaScript API
- Places API (New)
- Routes API (New)
- Distance Matrix API
- Geocoding API
- Direction API
- Geolocation API
⚠️ Must enable billing on your Google Cloud project.
Add Key to Your Project #
Android Setup #
File: android/app/src/main/AndroidManifest.xml
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_ANDROID_MAP_API_KEY" />
iOS Setup #
File: ios/Runner/AppDelegate.swift
import GoogleMaps
GMSServices.provideAPIKey("YOUR_IOS_MAP_API_KEY")
Also ensure ios/Podfile has:
platform :ios, '12.0'