我是IOS的新手。我必须向 Google 地方信息添加新地点。我已引用此链接https://developers.google.com/places/documentation/actions在按钮单击时添加位置,但我对为此传递参数感到困惑。
我的编码行是这样来获取的:
NSString *lat =@"-33.8669710";
NSString *longt =@"151.1957362";
gKey = @"my api key";
NSString *placeString = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/add/json?sensor=false&key=%@HTTP/1.1Host:maps.googleapis.com {\"location\":{\"lat\":%@,\"lng\":%@},\"accuracy\": 50,\"name\":\"Gimmy Pet Store!\",\"types\":[\"pet_store\"],\"language\":\"en-AU\"}",gKey,lat,longt];
placeString = [placeString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"Main Place Url: %@",placeString);
NSURL *placeURL = [NSURL URLWithString:placeString];
NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:placeURL];
[request setHTTPMethod:@"POST"];
NSURLConnection *placesConn =[[NSURLConnection alloc] initWithRequest:request delegate:self];