ios - Why am I getting com.facebook.sdk.login error 308? -


i using xcode 7.0, testing on ios 9.0.2 , using facebook sdk 4.7.0.

when logging in user, of time works should, keep getting error , have no idea why!

the operation couldn’t completed. (com.facebook.sdk.login error 308.)

after researching have seen people getting error when logging in parse.com's fbutils , official fbsdk @ same time, using fbsdk in project.

so question is, why getting error , how rid of it?

edit - adding code

here login logic:

func loginwithfacebook(sender: uiviewcontroller, completion: (profile: fbsdkprofile?, token: string?, cancelled: bool, error: string?) -> void ) {      fbsdkprofile.enableupdatesonaccesstokenchange(true)     nsnotificationcenter.defaultcenter().addobserver( sender , selector: "onprofileupdated:", name:fbsdkprofiledidchangenotification, object: nil)     let loginmanager = fbsdkloginmanager()     loginmanager.loginwithreadpermissions(["email", "public_profile"], fromviewcontroller: sender) { (result: fbsdkloginmanagerloginresult!, error: nserror!) -> void in         if error != nil {             print("error")             completion(profile: nil, token: nil, cancelled: false, error: error.localizeddescription)             print(error.localizeddescription)          } else if result.iscancelled {             print("cancelled")             completion(profile: nil, token: nil, cancelled: true, error: nil)          } else {             print("no error")             if fbsdkprofile.currentprofile() == nil {                 print("profile nil")                 completion(profile: nil, token: result.token.tokenstring, cancelled: false, error: nil)             } else {                 print("profile not nil")                 completion(profile: fbsdkprofile.currentprofile(), token: result.token.tokenstring, cancelled: false, error: nil)             }          }      } } 

for xcode8 - ios10,

enable keychain sharing within capabilities tab of target fixed issue.

enter image description here

more details can found here : https://github.com/facebook/facebook-sdk-swift/issues/51


for xamarin studio (suggested @kenneth),

add entitlements.plist file custom entitlements under ios bundle signing options in ios project.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -