-1

I am new in iOS.

I am trying to show nearby places with selected types types – Bar, Cafe, ATM etc

I have created project on developer console. enable API (google places api, google map sdk, direction api)

I have created iOS api keys but Api key not working I got error message “This IP, site or mobile application is not authorized to use this API key. Request received from IP address 114.143.244.10, with empty referer”

when I tried browser api key I got error “This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console

I am using this url

NSString *url = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search/json?location=%f,%f&radius=%@&types=%@&sensor=true&key=%@", currentCentre.latitude, currentCentre.longitude, [NSString stringWithFormat:@"%i", currenDist], googleType, kGOOGLE_API_KEY];

I didn’t get what is the problem.

places not found using google places api in iOS

  • http://stackoverflow.com/questions/21933247/this-ip-site-or-mobile-application-is-not-authorized-to-use-this-api-key go throught this link –  Jan 19 '16 at 06:46
  • i'm getting like this { "error_message": "The provided API key is expired.", "html_attributions": [], "results": [], "status": "REQUEST_DENIED" } – Ravinder Reddy Jan 19 '16 at 06:57

1 Answers1

2

Try below solutions

Solution 1: Google place services will take 10 minutes to make the services available for new API KEY created. Services will stat working after 10 minutes, till then we get error as "The provided API key is expired."

Solution 2: Do this in google developer console:

Create key for browser applications not for android application

Enable: Google Places API Web Service

Wait for approx 10 min till it approves

May be it will help you.

  • previously i'm getting like api key expired but now i'm getting like this "This IP, site or mobile application is not authorized to use this API key. Request received from IP address 183.82.107.31, with empty referer", "html_attributions": [], "results": [], "status": "REQUEST_DENIED" – Ravinder Reddy Jan 19 '16 at 07:16
  • my request format:https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=17.4479216,78.377201&radius=5000&sensor=true&key= AIzaSyBfpw3WU8q0Bi_DRh1c-rbeQJOwa-IRYcc – Ravinder Reddy Jan 19 '16 at 07:17
  • I get the same status what ever you got @Ravinder Reddy please help me how you get solve this solution.? – Hari Narayanan Apr 03 '18 at 11:22
  • At first two three times only i got the json response. – Hari Narayanan Apr 03 '18 at 11:24