Git Product home page Git Product logo

Comments (13)

hirbod avatar hirbod commented on August 25, 2024

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.

jeduan avatar jeduan commented on August 25, 2024

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.

hirbod avatar hirbod commented on August 25, 2024

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.

GitRubb avatar GitRubb commented on August 25, 2024

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.

jeduan avatar jeduan commented on August 25, 2024

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.

hirbod avatar hirbod commented on August 25, 2024

@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

img_8758

from cordova-plugin-facebook4.

GitRubb avatar GitRubb commented on August 25, 2024

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.

hirbod avatar hirbod commented on August 25, 2024

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.

sean-hill avatar sean-hill commented on August 25, 2024

Yeah it's just super frustrating that the SDK does this:

img_1483

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.

jeduan avatar jeduan commented on August 25, 2024

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.

sean-hill avatar sean-hill commented on August 25, 2024

Thanks @jeduan!

from cordova-plugin-facebook4.

mattchete avatar mattchete commented on August 25, 2024

Yeah thanks a lot :)

from cordova-plugin-facebook4.

jeduan avatar jeduan commented on August 25, 2024

I meant the fix will come, not from me, but from Facebook :p

from cordova-plugin-facebook4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.