2

I keep receiving REQUEST_DENIED when trying to use Google Places Autocomplete for iOS.

The example link is https://maps.googleapis.com/maps/api/place/autocomplete/json?input=londo&location=45.647157,25.628332&key=AIzaSyCHRmOeUQCcI_1JbcWiJ (I have ommited some of the last characters of the key)

  1. Both Google Places API and Google Maps API are enabled from Google Developer Console
  2. I have a valid key in Credentials section, for which I also added my bundle identifier in the list of bundle identifiers
  3. The key is an iOS applications key, in Public API access section. It's valid and is created by me (owner)

Can anyone point me out to the good direction ? Thanks in advance.

Dani Pralea
  • 4,545
  • 2
  • 31
  • 49
  • Maybe this will help: http://stackoverflow.com/questions/9060563/google-places-api-request-denied Also make sure that you dont get access denied using browser – Luzgan Jun 05 '15 at 20:29
  • thanks I tried that as well, but so far it has not helped me – Dani Pralea Jun 08 '15 at 07:45

4 Answers4

3

I found the problem: you need to enable the Google Places Web Services as well and use the server key (Funny enough, this thing is not specified in any of their docs)

Dani Pralea
  • 4,545
  • 2
  • 31
  • 49
  • Enabling Google Places Web Services and using the iOS key worked for me. Unfortunately in this link (https://developers.google.com/places/ios-api/start#step-5-get-an-api-key---objective-c) they claim they will walk you through the process via wizard (https://console.developers.google.com/flows/enableapi?apiid=placesios,maps_ios_backend&keyType=CLIENT_SIDE_IOS) but that does not work. Their manual steps also do not work in the above link. It does seem you need to enable Google Places Web Services for the iOS key to work – Tony Jan 11 '16 at 18:05
1

Directions API require not iOS key, but server key. When you'll create server key, leave text view blank, do not enter your bundle name.

Shmidt
  • 16,436
  • 18
  • 88
  • 136
1

Use Browser key or server key for Google Places Autocomplete API. Keep the referrer field as empty. Make sure you enable Google Places API in the developers console.

idrisjafer
  • 725
  • 1
  • 14
  • 29
0

I met the same problem last week and struggled for quite a while. The way I solved the problem is to follow the Google Places API for iOS https://developers.google.com/places/ios/start. Use GMSPlacesClient instead of JSON calls.

Jian
  • 1
  • 1