【发布时间】:2013-09-09 20:05:49
【问题描述】:
所以我正在尝试使用 iOS SDK 通过 Facebook 图形 API 获取页面名称:
NSDictionary* params = [NSDictionary dictionaryWithObject:@"id,name" forKey:@"fields"];
[[FBRequest requestWithGraphPath:[NSString stringWithFormat:@"%@", userId] parameters:params HTTPMethod:nil] startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
name = [result objectForKey:@"name"];
//do more stuff
}];
我收到了错误
error = {
code = 803;
message = "(#803) Some of the aliases you requested do not exist: (null)";
type = OAuthException;
};
我的 accesstoken 是有效的,当我将 Graph API Explorer 与 GET 请求 5120148605?fields=id,name,about,bio 一起使用时,它确实有效。
有人知道这种奇怪的行为吗?
【问题讨论】:
-
你收到
id了吗?你得到的result是什么? -
结果为零。我只是收到错误消息,但对我的朋友来说它有效,只是不适用于页面。很奇怪。
-
您提出什么要求?
/page_id?如果是,您提供的 page_id 是什么? -
我正在使用我的时间线的页面 ID。例如
5120148605。 -
我现在通过
userId = [NSString stringWithFormat:@"%@", userId]解决了这个问题。似乎我需要这个页面而不是用户。很奇怪。
标签: ios facebook facebook-graph-api facebook-ios-sdk facebook-access-token