No locations found using google api sites in iOS

I am trying to show neighboring places with selected types of types - bar, cafe, ATM, etc.

I created a project in the developer console. enable API (google places api, google map sdk, direction api)

I created iOS api keys, but the Api key does not work. I got an 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 an empty referrer

When I tried the api key browser, I got this error

This API project is not authorized to use this API. Make sure that this API is activated in the API console: Learn more: https://code.google.com/apis/console

I use 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 do not understand what the problem is.

+7
ios search google-places-api
source share
4 answers

Enable this API and the Google Places API for iOS in the API.

Refer to this document ....

Google Places API Web Service

https://developers.google.com/places/webservice/search

+3
source share

Please verify that all of your APIs are enabled in the Google Developer Console.

Step 1 Go to the developer console

Step 2 API Manager ==> API Library ==> Google Maps APIs ==> Learn More

Step 3 And Enable ==> Google Places API Web Service (AutoFill and Save)

Step 4 Finish Enjoy (^_^) ALl Done !!!!

NOTE: - Make sure your API key is correctly and well created.

+1
source share

I think I know your problem now, maybe you skipped a step.

steps should be:

1) Go to the Developer Console https://code.google.com/apis/console/

2) In Credentials, in the Public API Access section, Create New key

3) Select a server key from the option.

4) Enter your IP address in the box and, if you have more IP addresses, you can simply add to each line. NOTE: Enter the IP address only if you want to use it for testing purposes. It remains to leave the IP address field blank.

5) When finished, click Create, and your new server key will be generated, and you can add this server key to your URL.

use it like:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=[lat],[lon]&radius=[radius]&key=kGOOGLE_API_KEY&sensor=true

or from the textbook you are using.

https://maps.googleapis.com/maps/api/place/search/json?location=[lat],[lon]&radius=[radius]&types=[type]&key=kGOOGLE_API_KEY&sensor=true

as you can see, &sensor=true is the last parameter .. (do not trust anything on the Internet) .. hahaha ..

everything should have worked if you followed carefully .. I suggest doing it from above .. hahaha .. Lols .. you will know and find out what is lost / forgotten and this will help you become a better person .. Lols .. Good luck sir. . :)

0
source share

Try using this https://github.com/FuerteInternational/FTGooglePlacesAPI library with your key and let me know.

0
source share

All Articles