3

I'm am developing an iOS map which uses Google Maps to search and display nearby pharmacies. I enabled the following API's: Geocoding API, Google Maps SDK for iOS, Places API. I created a Browser Key, an iOS Key, and a Server Key.

NSString *str = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=%f,%f&radius=500&types=food&name=cruise&key=MY_KEY",location.coordinate.latitude, location.coordinate.longitude];

NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:str]
                                          cachePolicy:NSURLRequestUseProtocolCachePolicy
                                      timeoutInterval:60.0];

NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];

if (theConnection)
{
    receivedData = [NSMutableData data];
}

After the connection finishes and with the browser key used:

"The provided API key is expired."

After the connection finishes and with the app key used:

"This IP, site or mobile application is not authorized to use this API key."

What could be the problem ?

Macaret
  • 797
  • 9
  • 33

0 Answers0