Then in viewDidLoad() add the following code: // Create a GMSCameraPosition that tells the map to display the Now go over to ViewController.swift, also below import UIKit add: import GoogleMaps Then below import UIKit add: import GoogleMaps Replace YOURAPIKEYHERE with the API key you just got from google GMSServices.provideAPIKey("YOURAPIKEYHERE") Head over to the AppDelegate.swift file and in didFinishLaunchingWithOptions add the following line which authenticates your app from your API key. DO not share this with anyone else, otherwise they can use up your free API calls, although the limit is high, with a high traffic app this can be reached easily. This will be used as authentication from your app to access Google Maps. Once you have done this you will get an API key that looks something like : Use the standard Google Maps SDK for iOS, and create an app. xcworkspace file and lets add Google Maps to your app! Get an API keyīefore you are able you use Google Maps in your app you need to get an API key here. When this is done open up the yourproject. Once done back in terminal run pod install to integrate the Google Maps SDK with your project. Replace the contents with the following: # Navigate to the project directory in terminal, and use pod init to create your podfile. Then you need to close the app as we need to use Cocoapods (Not sure what this is – check out our tutorial here) to integrate the Google Maps SDK with our project. Lets create a simple app to showcase this with your current location and some markers of Pokemon that might be lurking around the area if you were to play Pokemon Go! Setting up the projectįirst of all create a new single view application in XCode. Integrating Google Maps SDK into your iOS app is easy thanks to Cocoapods.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |