0
我正試圖獲得Facebook Accesstoken。當我打印accessToken時,它會返回一個帶有appId和authenticationToken的對象,我如何解析出令牌? 我使用下面的代碼:Swift get Facebook AccessToken
let loginManager = LoginManager()
loginManager.logIn([ .publicProfile, .userFriends, .email ], viewController: self) { loginResult in
switch loginResult {
case .failed(let error):
print(error)
case .cancelled:
print("User cancelled login.")
case .success(let grantedPermissions, let declinedPermissions, let accessToken):
print("accessToken: " + String(describing: accessToken))
break
}
}
http://stackoverflow.com/a/42266558/5 461400試試這個 –
你可以直接獲取訪問令牌'FBSDKAccessToken.current()' –