简体   繁体   中英

Can't login with Facebook SDK on cordova iOS after changing permissions

I'm using Cordova latest version with this plugin https://github.com/jeduan/cordova-plugin-facebook4 ... In the first version, I was getting permission for only:

id,email,birthday

And in the 2nd version, I am getting permission for:

id,email,birthday,gender,first_name,last_name

which causes the following error:

domain=com.facebook.sdk.login code=304

But if I removed the app and re-installed it, it works fine!

So, what should I do now? the app in production, and all users can't login, and it is really hard to ask all users to remove the app and re-install it! any idea to release another version with a patch to fix this issue?

I think there is a solution here: ios facebook sdk 4.0 login error code 304 , but I'm not a good Objective C developer to know how to implement it in the plugin!

The issue is because the cordova facebook plugin call facebookConnectPlugin.getLoginStatus() caches the FB response. It doesn't allow us to force a server trip in that call (whereas in the FB Javascript SDK it does).

I resolve the issue by calling facebookConnectPlugin.login() when I get 304. That forces a server trip to reload the FB permission upon a fresh login.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM