Skip to content

Instantly share code, notes, and snippets.

@belal-mazlom
Last active July 18, 2017 21:00
Show Gist options
  • Save belal-mazlom/6cc880f63376e700c8d3f59069a052b6 to your computer and use it in GitHub Desktop.
Save belal-mazlom/6cc880f63376e700c8d3f59069a052b6 to your computer and use it in GitHub Desktop.
React native Maps install and activte Google map on iOS
I get a lot of issues when I tried to install react-native-map
So I liked to share my steps to install react native maps and activate Google map provider
Please check details in comment below
@belal-mazlom
Copy link
Author

Using airbnb/react-native-maps
This steps for React Native 40 and above.
Initialize New React native
Install 0.13.0 of react-native-maps

npm install https://github.com/airbnb/react-native-maps.git#v0.13.0 --save

Don't link package using react-native link

Go to ios dirctory
cd ios

Add pod file like the one added in example of package
Podfile
Replace target with project name

Execute
pod install

Open Xcode project
Drag and drop inside root of project
node_modules/react-native-maps/ios/AirGoogleMaps
node_modules/react-native-maps/ios/AirMaps

Inside AppDelegate.m add these:
#import <GoogleMaps/GoogleMaps.h>
Add under NSURL *jsCodeLocation;
[GMSServices provideAPIKey:@"GoogleAPIKey"];

It should be ready to use
Inside React native js files you could add MapView tag and show map component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment