我已经成功地将 Facebook 登录包含在我的 IOS 应用程序中,但是我似乎在获取一些用户的基本信息(例如姓名、电子邮件等)时遇到了一些困难......
我当前的代码如下所示:
// Ask for the required permissions
self.loginView.readPermissions = @[@"basic_info",
@"user_location",
@"user_birthday",
@"user_likes"];
// Fetch user data
[FBRequestConnection
startForMeWithCompletionHandler:^(FBRequestConnection *connection,
id<FBGraphUser> user,
NSError *error) {
if (!error) {
// Display the user info
tempLabel.text = user.name;
}
}];
然而,总是有一个错误(if 语句检查!error,它总是等于 false)。
有人可以帮我解决这个问题吗?
谢谢,杰克
编辑:
2013-08-04 15:52:03.457 Ludis[37821:c07] {
"com.facebook.sdk:HTTPStatusCode" = 400;
"com.facebook.sdk:ParsedJSONResponseKey" = {
body = {
error = {
code = 2500;
message = "An active access token must be used to query information about the current user.";
type = OAuthException;
};
};
code = 400;
};
}
2013-08-04 15:52:03.458 Ludis[37821:c07] The operation couldn’t be completed. (com.facebook.sdk error 5.)