xcode - Google API key not working - iOS -


i have tried everything. trying request places using google place api. however, receiving request denied. key browser apps works fine if use in ios code, is:

- (ibaction)google:(id)sender {          nserror *error;      nsstring *lookupstring = [nsstring stringwithformat:@"https://maps.googleapis.com/maps/api/place/search/json?location=-37.849968,145.046310&radius=500&types=food&sensor=true&key=aizasycbg9ursqsxytrf7h9nrg66ers-bhcm9j0"];      lookupstring = [lookupstring stringbyreplacingoccurrencesofstring:@" " withstring:@"+"];      nsdata *jsonresponse = [nsdata datawithcontentsofurl:[nsurl urlwithstring:lookupstring]];     nsstring *newstr = [[nsstring alloc]initwithdata:jsonresponse encoding:nsutf8stringencoding];     nslog(@"locationarray count: %@", newstr);      nsdictionary *jsondict = [nsjsonserialization jsonobjectwithdata:jsonresponse options:kniloptions error:&error];      nsarray *locationarray = [[jsondict valueforkey:@"results"]valueforkey:@"formatted_address"];      int total = locationarray.count;     nslog(@"locationarray count: %d", locationarray.count); } 

i have searched everywhere , couldn't find help.

ps1: real key (it test).

ps2: bundle identifies according xcode is: dsg.jsontest (is fine?)

thank help


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -