Skip to content

Commit 961afd2

Browse files
Revert "Remove iOS instructions from the maps plugin readme. (flutter#744)"
This reverts commit 60252de.
1 parent 41bd316 commit 961afd2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/google_maps_flutter/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/
3030
3131
Get an API key at <https://cloud.google.com/maps-platform/>.
3232
33+
### Android
34+
3335
Specify your API key in the application manifest `android/app/src/main/AndroidManifest.xml`:
3436

3537
```xml
@@ -39,6 +41,28 @@ Specify your API key in the application manifest `android/app/src/main/AndroidMa
3941
android:value="YOUR KEY HERE"/>
4042
```
4143

44+
### iOS
45+
46+
Supply your API key in the application delegate `ios/Runner/AppDelegate.m`:
47+
48+
```objectivec
49+
#include "AppDelegate.h"
50+
#include "GeneratedPluginRegistrant.h"
51+
#import "GoogleMaps/GoogleMaps.h"
52+
53+
@implementation AppDelegate
54+
55+
- (BOOL)application:(UIApplication *)application
56+
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
57+
[GMSServices provideAPIKey:@"YOUR KEY HERE"];
58+
[GeneratedPluginRegistrant registerWithRegistry:self];
59+
return [super application:application didFinishLaunchingWithOptions:launchOptions];
60+
}
61+
@end
62+
```
63+
64+
### Both
65+
4266
You can now add a `GoogleMap` widget to your widget tree.
4367

4468
The map view can be controlled with the `GoogleMapController` that is passed to

0 commit comments

Comments
 (0)