Places API not enabled for iOS even if it's already enabled

余生颓废 提交于 2019-12-12 09:53:44

问题


I have integrated Places Autocomplete or Places API along with Maps, Google Login and Firebase RealtimeDatabase. But when I run the app, the error says: "The operation couldn’t be completed. The Places API for iOS is not enabled. See the developer's guide (https://developers.google.com/places/ios-api/start) for how to enable the Google Places API for iOS."

Places was working fine until: Last week, I had to ditch my Firebase project and create a new one. Did what was required: -changed the GoogleServices-info.plist -client ID -url types

I have already enabled the Google Places API in my Google Cloud Platform, too.

And in my

application(didFinishLaunchingwithOptions:)
GMSServices.provideAPIKey("<key from project>")
GMSPlacesClient.provideAPIKey("<key from project>")

Bear in mind that Google Maps, Google Sign In and Firebase Database are all working just fine. The project is shared by the android version, too and the places api is working fine there. Can't seem to figure out the issue.


回答1:


Ok Asmin, so i run into the same issue this morning so i feel obligated to answer since i solved it after 5 hours! So the issue is with the pod version. GooglePlaces 2.7.0 is deprecated however when you run pod install 2.7.0 is what is installed not the present 3.0.2. Once i realized that, this is what i did. I opened the terminal, cd to my project folder and run pod update, or better yet pod update --verbose so i can see what's happening. Well, it worked!! The pods got updated to 3.0.2 and now everything works fine. Yaay! I love/hate programming!!

NB: anyway, if you try it and it doesn't work, then run update repo, and repeat pod update.

You have my word; it's going to work




回答2:


Make sure you are in the correct Google account when configuring the API keys. Also make sure your key can be used for the iOS platform, double check that you enabled both Google Maps and Google Places and finally, make sure your bundle ID is allowed to use the API key.




回答3:


In my case nothing worked. I have updated my pod and Google Place Picker SDK version 3.0.2 .But unfortunately Google have deprecated Google Place Picker since January 29, 2019 Link .

  1. I have to follow the google migration guid and Wrote my own controller to search for places with given string and populate those results in my table view Link.
  2. Than fetch the place detail by place ID Link.

Note: It will cost you extra API call if you want Place Detail



来源:https://stackoverflow.com/questions/54625532/places-api-not-enabled-for-ios-even-if-its-already-enabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!