2017-03-08 9 views
-1

私はFacebookのログインを使用してアプリケーションを作成しました。私がこのアプリケーションを実行すると、以下のエラーが表示されます。Facebookログインエラー無効なスコープ:users_friends

error: canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -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..") 
} 
} 

What I've got on Info.plist

The error I get on the App

答えて

0

この行をあなたの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> 
+0

私は同じエラーを取得 –

関連する問題