我是使用Swift快速学习的自学开发iPhone应用程序。我正在设计一个使用FBSDK进行Facebook身份验证的登录页面。我已经成功实现了登录和注销的登录按钮。它返回用户名和ID,但无法绘制用户电子邮件ID的图形,并显示代码2500错误。另外,我无法使用新用户登录。它会自动以同一用户登录。
这是错误:
UserInfo={com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey=0, com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=400, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=An active access token must be used to query information about the current user., com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode=2500, com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey={
body = {
error = {
code = 2500;
"fbtrace_id" = BimF4Nuqx0v;
message = "An active access token must be used to query information about the current user.";
type = OAuthException;
};
};
code = 400;
}})
Successfully logged in with Facebook...
123
result Optional({
id = 120008981838163;
name = "Nisha Ios";
})
Did Logout of Facebook
Run Code Online (Sandbox Code Playgroud)
这是我在AppDelegate.swift中的代码:
import UIKit …Run Code Online (Sandbox Code Playgroud)