Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Integrate native alert permission on iOS instead of jumping around apps #18

Closed
hirbod opened this issue Aug 11, 2015 · 13 comments
Closed

Comments

@hirbod
Copy link
Collaborator

hirbod commented Aug 11, 2015

Please provide the native facebook permission alert. "Jumping" around the apps is so ugly and so 2013.
ccsoft/cordova-facebook#65

I would love to do this by myself, but I really don't have enough know how on this. I hope we could see some of this features. If you want, I could open an own ticket for my wishes but I thought this thread is a good place for it.

There was a ticket on the original Facebook plugin.
Wizcorp#910

Seems like this is not a big deal to implement. Only a few code changes inside of the FacebookConnect.m file. I don't know if this has any sideeffects.

@hirbod
Copy link
Collaborator Author

hirbod commented Aug 11, 2015

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.

@jeduan
Copy link
Owner

jeduan commented Aug 11, 2015

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)

@hirbod
Copy link
Collaborator Author

hirbod commented Aug 11, 2015

I understand. But what about FBSessionLoginBehaviorUseSystemAccountIfPresent

This worked with the Facebook SDK < 4. It checked for SystemAccount and fall back to app-switching.

@GitRubb
Copy link

GitRubb commented Aug 15, 2015

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;

@jeduan
Copy link
Owner

jeduan commented Sep 10, 2015

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.

@hirbod
Copy link
Collaborator Author

hirbod commented Sep 10, 2015

@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

@GitRubb
Copy link

GitRubb commented Sep 10, 2015

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.

@hirbod
Copy link
Collaborator Author

hirbod commented Sep 10, 2015

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

@sean-hill
Copy link

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.

@jeduan
Copy link
Owner

jeduan commented Sep 18, 2015

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.

@sean-hill
Copy link

Thanks @jeduan!

@mattchete
Copy link

Yeah thanks a lot :)

@jeduan
Copy link
Owner

jeduan commented Sep 18, 2015

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

@jeduan jeduan closed this as completed Feb 4, 2016
Luro91 pushed a commit to platogo/cordova-plugin-facebook4 that referenced this issue Mar 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants