swift - Facebook login for iOS error: The operation couldn’t be completed. (com.facebook.sdk.core error 3.) -
i'm receiving error code:
the operation couldn’t completed. (com.facebook.sdk.core error 3.)
for logging facebook on app , not sure why. here viewcontroller code:
import fbsdkcorekit import fbsdkloginkit @iboutlet weak var facebookloginbutton: fbsdkloginbutton! override func viewdidload() { super.viewdidload() facebookloginbutton.readpermissions = ["public_profile", "email", "user_friends"] facebookloginbutton.delegate = self } //mark: facebook login func loginbutton(loginbutton: fbsdkloginbutton!, didcompletewithresult result: fbsdkloginmanagerloginresult!, error: nserror!) { if error == nil { print("login complete") performseguewithidentifier("facebooksegue", sender: self) } else { print(error.localizeddescription) } } func loginbuttondidlogout(loginbutton: fbsdkloginbutton!) { print("user logged out") }
here appdelegate:
import fbsdkcorekit func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { // override point customization after application launch. //facebook login return fbsdkapplicationdelegate.sharedinstance().application(application, didfinishlaunchingwithoptions: launchoptions) } func application(application: uiapplication, openurl url: nsurl, sourceapplication: string?, annotation: anyobject) -> bool { //facebook login return fbsdkapplicationdelegate.sharedinstance().application(application, openurl: url, sourceapplication: sourceapplication, annotation: annotation) }
i think code correct maybe i'm missing something, appreciated!
was able figure out. plist file had modified followed:
<key>lsapplicationqueriesschemes</key> <array> <string>fb</string> <string>fbapi</string> <string>fbauth2</string> <string>fbshareextension</string> <string>fb-messenger-api</string> </array>
after adding worked!
Comments
Post a Comment