Facebook 로그인을 iOS 10 앱에 swift 3.0으로 통합하려고합니다.오류 코드 2500 Swift 3.0의 Facebook 로그인
오류 코드 콘솔 :
body = {
error = {
code = 2500;
"fbtrace_id" = FpAkfsaBAFc;
message = "An active access token must be used to query information about the current user.";
type = OAuthException;
};
};
code = 400;
}})
loginButton 기능 loginViewController에 :
func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) {
fetchProfile()
print("@@@@Completed [email protected]@@@")
}
내가는 FacebookSDK 응용 프로그램에 설치 한 후 아래 그림과 같이 오류 코드 2500을 받고 loginVC에서 Facebook 프로필 기능 가져 오기 :
,func fetchProfile() {
let parameters = ["fields": "email, first_name, last_name, picture.type(large)"]
FBSDKGraphRequest(graphPath: "me", parameters: parameters).start(completionHandler: { (connection, user, requestError) -> Void in
if requestError != nil {
print(requestError)
print("There are some error during getting the request from fb")
return
}
self.email = (user?["email"] as? String)!
self.firstName = (user?["first_name"] as? String)!
self.lastName = (user?["last_name"] as? String)!
self.nameLabel.text = "\(self.firstName) \(self.lastName)"
print("My fbname is " + self.firstName)
print(self.lastName)
var pictureUrl = ""
if let picture = user?["picture"] as? NSDictionary, let data = picture["data"] as? NSDictionary, let url = data["url"] as? String {
pictureUrl = url
print(pictureUrl)
}
})
}
AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
return true
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: AnyObject) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
}
비슷한 스택 오버 플로우에 대한 질문,하지만 빠른 3.0에서 작동하지 않는 검색은 사람이 문제, 감사에 대한 조언과 좋은를 가질 수 있다면 감사하겠습니다 더라면 일!
감사합니다. – aznelite89