Click here to Skip to main content
15,881,580 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Integrated Google maps in my iOS app

1. generated API key
2. defined key restriction for iOS app and app bundle ID
3. added pod
4. defined api key in my AppDelegate as
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        UIApplication.shared.statusBarStyle = .lightContent
        GMSServices.provideAPIKey("AIzaSyA8D1awYfmGSQuhmtY_TSqtafUXMtQjeuk")
        return true
    }

5. launch app and see empty map view.

In log I see this:
Quote:

2017-06-16 19:15:27.842 {app name}[12134:333695] Google Maps SDK for iOS cannot connect or validate APIKey: Error Domain=com.google.HTTPStatus Code=400 "(null)" UserInfo={data=<3c48544d 4c3e0a3c 48454144 3e0a3c54 49544c45 3e426164 20526571 75657374 3c2f5449 544c453e 0a3c2f48 4541443e 0a3c424f 44592042 47434f4c 4f523d22 23464646 46464622 20544558 543d2223 30303030 3030223e 0a3c4831 3e426164 20526571 75657374 3c2f4831 3e0a3c48 323e4572 726f7220 3430303c 2f48323e 0a3c2f42 4f44593e 0a3c2f48 544d4c3e 0a>}

2017-06-16 19:15:27.842 {app name}[12134:333695] Your key may be invalid for your bundle ID: {bundle id}


What did I forget to do?

What I have tried:

I checked my app bundle id, it is correct (copy-pasted from Xcode)
Posted
Updated 16-Jun-17 4:22am

1 solution

I forgot enable Google Maps iOS SDK in google developer console.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900