Comments (13)
But actually, your login-code is different, as you, @jeduan, have integrated the new Facebook SDK.
But I think this should be simple to adjust.
from cordova-plugin-facebook4.
Actually, that code just checks if there's an active session, and doesn't present the login which is sort of different from the native implementation. Apparently the native class is ACAccount and Facebook did use that in their SDK but switched. We'd have to see if there's a way for the SDK to use the Token if the user signs in with ACAccount, otherwise it would only be useful if the app will not use anything else (graph, dialogs, etc)
from cordova-plugin-facebook4.
I understand. But what about FBSessionLoginBehaviorUseSystemAccountIfPresent
This worked with the Facebook SDK < 4. It checked for SystemAccount and fall back to app-switching.
from cordova-plugin-facebook4.
To get native auth working, in the login function add
login.loginBehavior = FBSDKLoginBehaviorSystemAccount;
The resulting code block should look like this:
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
login.loginBehavior = FBSDKLoginBehaviorSystemAccount;
[login logInWithReadPermissions:permissions handler:loginHandler];
return;
from cordova-plugin-facebook4.
Ok, so I looked into this, and bumped into https://developers.facebook.com/docs/ios/errors#renew says
In the case of FBSDKLoginBehaviorSystemAccount, the UI is provided by iOS natively. As a result, there can be errors that require user action to resolve such as if they changed their password on www.facebook.com or their account has been disabled for security reasons.
In those cases the login API will provide an appropriately coded NSError instance (with the above localized keys) that you can display. Note FBSDKLoginBehaviorSystemAccount is not the default login behavior, and the other login behaviors will provide appropriate messaging in the login dialog automatically.
So basically this is a breaking change as the plugin user would need to handle stuff that is currently handled by the SDK. This is not great, and I'd put it behind an option but we only accept an array of permissions in .login
at the moment. I'll have to think more about this.
from cordova-plugin-facebook4.
@jeduan
It would be great if the plugin itself could have two login-interfaces. The normal, current way, and a special (for iOS only) way (like .loginWithNativePrompt()) or something like that.
I don't know if this is possible and how much extra-work this would cost, but it would be very nice, as of iOS 9, the App ask if it has permission to open Facebook, and after login it ask's the Facebook-App, if it has permission to return back. Something bad on this is, that after loggin in the normal way on iOS 9, the user will see a "return to facebook" message instead of the network carrier name.
Really ugly, as it may interupt status-bar-taps (e.g for scrolling up).
See my screenshot on my iPhone 5 with iOS 9 Public Beta 3
from cordova-plugin-facebook4.
I had FBSDKLoginBehaviorSystemAccount released in our app and after seeing the auth failures come in, I would now agree to using the default auth flow. Unless this plugin can recover and run the default auth method after an FBSDKLoginBehaviorSystemAccount failure it's not worth having as default.
I've seen a lot of 'invalid accounts' 'password needs updating' messages where the user's Facebook system account isn't properly setup or needs updating resulting in auth failures.
from cordova-plugin-facebook4.
I totaly agree. I would just set this up as an additional logon flow for those who need it. Would love to know how e.g tinder with more than 500 mio user handle this, as they use the system logon flow only
from cordova-plugin-facebook4.
Yeah it's just super frustrating that the SDK does this:
I'm like, what's the point of Facebook login then? I used it before in iOS 8 for a one click login process, but now it looks like it's requiring them to login with their username and password for iOS 9.
from cordova-plugin-facebook4.
I know there's a way for apps to be linked to a domain and share cookies/login info, so I know for sure this will be fixed. Just give it a couple of weeks.
from cordova-plugin-facebook4.
Thanks @jeduan!
from cordova-plugin-facebook4.
Yeah thanks a lot :)
from cordova-plugin-facebook4.
I meant the fix will come, not from me, but from Facebook :p
from cordova-plugin-facebook4.
Related Issues (20)
- Plugin does not work on browser platform with Cordova 9 HOT 1
- get acces_token for send in my personnal login HOT 1
- cordova-plugin-facebook4 issue with UIWebView HOT 29
- Unable to start the app and initializing the SDK. HOT 2
- IOS ITMS-90683: Missing Purpose String in Info.plist - NSLocationWhenInUseUsageDescription HOT 1
- Compatibility Facebook SDK v7 HOT 10
- Cordova app closes after displaying Facebook login screen HOT 1
- App/Plugins/cordova-plugin-facebook4/FacebookConnectPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler HOT 1
- On FB Dialog Login Screen HOT 2
- How i can get deep link?
- Error: Unable to merge dex HOT 1
- While using latest version of google plugin with cordova-plugin-facebook4 app is crashing HOT 1
- IONIC 5 - delay transition pages after login HOT 1
- Got error on facebook/index.js file on login HOT 1
- Facebook Login Suddenly Fails on Oct 1st - Permission Error HOT 4
- Facebook login is not redirecting back to app when you facebook app installed HOT 5
- Facebook api calling a users picture (no redirect) HOT 1
- unable to upgrade to FB SDK (iOS) 8.1.0 HOT 21
- IOS facebook sdk 5.15.0 is deprecated HOT 2
- Failed to install 'cordova-plugin-facebook4': Error: pod: Command failed with exit code 1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-facebook4.