1

我使用以下代码来获取我在 Facebook iOS SDK 中的位置信息。

[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"search?type=place&center=%f,%f&distance=200&limit=100&offset=0", la, lo] completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
    if (error) {
        NSLog(@"error.localizedDescription:%@", error.localizedDescription);
    }

    NSArray *list = [result objectForKey:@"data"];
    NSLog(@"list:%@", list);
}];

这些以前工作正常,但今天失败了。这是错误信息。

The operation couldn’t be completed. (com.facebook.sdk error 5.)

我去 facebook API 页面。(http://developers.facebook.com/docs/reference/api/search/

而且,我发现https://graph.facebook.com/search?q=coffee&type=place¢er=37.76,-122.427&distance=1000返回零。

所以,我试图弄清楚这个问题是否是由于facebook,而我唯一能做的就是等待?

4

1 回答 1

1

使用最新的 SDK

NSMutableDictionary *params2 = [NSMutableDictionary dictionaryWithCapacity:3L];

    [params2 setObject:@"37.416382,-122.152659" forKey:@"center"];
    [params2 setObject:@"place" forKey:@"type"];
    [params2 setObject:@"1000" forKey:@"distance"];

    [[[FBSDKGraphRequest alloc] initWithGraphPath:@"/search" parameters:params2 HTTPMethod:@"GET"] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
        NSLog(@"RESPONSE!!! /search");
        NSLog(@"result %@",result);
        NSLog(@"error %@",error);
    }];
于 2015-12-17T16:42:15.277 回答