English 中文(简体)
RE RequestST_DENIED in responce of 谷歌之地
原标题:REQUEST_DENIED in responce of Google Places API Request (sensor=true)

我正试图利用谷歌之首,在我所在地周围找到地方。

根据该守则,在搜查地点时点击URL。

NSString *URL = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&sensor=true&key=0dp-j3dkCU_YUb97RHcbL5shmRrJ5R2y4bYz1Vw"];

NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:URL]
                                                           cachePolicy: NSURLRequestReloadIgnoringLocalCacheData
                                                       timeoutInterval: 4];
[request setValue:@"application/json" forHTTPHeaderField:@"accept"];
NSObject *id1 = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];

我收到以下答复,即由Jons格式。

{
  "html_attributions" : [],
  "results" : [],
  "status" : "REQUEST_DENIED"
}

关于搜索谷歌之窗,它说,“请问”的一般原因,是不正确的。 但是, 就我而言,我也说这是正确的。

有什么想法?

同样,我所利用的APICKey在Anthony、Piche和BlackBerry开发的申请也很常见。 是否是? 或者,我是否需要另一张APICKey(我的Pipe App)? 因此, 另一个问题是。 能否在所有三个平台上使用同样的钥匙?

最佳回答

我拿你们的URL,代之以我知道行之有效的关键,得出预期结果。 首先,我猜测,您的复印件/用具的钥匙不正确,或者你未能使该项目的APICS成为这一关键人物。

必须指出,每个项目都能够提供不同的服务,而且你必须使每个希望与项目一起使用的APIC网站能够手工操作,你能否确认该项目在奥塞罗里是能够做到的,钥匙是准确复制的?

问题回答

如果你缺乏必要的参数,这一错误信息也可以出现。

例如,我刚刚使用<代码>/autocomplete终端点使用APICA。

Sending a request to https://maps.googleapis.com/maps/api/place/autocomplete/json?key=XXXXXXXXXXXXXXXXXX&input=San, I was getting a response like this:

{
   "predictions" : [],
   "status" : "REQUEST_DENIED"
}

尽管它看起来像是许可问题(至少对我来说),但我根本就没有必要的<条码>传感器/代码>参数。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...