[英]Facebook Login Error Invalid Scope: users_friends
我已經使用Facebook登錄名創建了一個應用,當我運行該應用時,出現以下錯誤。
錯誤:canOpenURL:URL失敗:“ fbauth2:/”-錯誤:“操作無法完成。(OSStatus錯誤-10814。)”
class ViewController: UIViewController, FBSDKLoginButtonDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
if(FBSDKAccessToken.current()==nil){
print("Not Logged In")
}
else{
print("Logged In..")
}
let loginButton = FBSDKLoginButton()
loginButton.delegate = self
loginButton.readPermissions = ["public_profile","email","users_friends"]
loginButton.center = self.view.center
self.view.addSubview(loginButton)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) {
if(error == nil){
print("login complete")
}
else{
print(error.localizedDescription)
}
}
func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!) {
print("Logged out..")
}
}
它是user_friends
而不是users_friends
。 權限參考-Facebook登錄
將此行添加到您的info.plist文件中。
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbauth</string>
<string>fbauth2</string>
<string>fb-messenger-api20140430</string>
</array>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.