facebook / facebook-sdk-for-unity

The facebook sdk for unity.
https://developers.facebook.com/docs/unity
Other
487 stars 256 forks source link

Login gets stuck in loop in 9.0.0 if Facebook app is installed #514

Closed SeriouslySam closed 3 years ago

SeriouslySam commented 3 years ago

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

Goals

I want to do Facebook login in the the application.

Expected Results

Facebook login to complete successfully.

Actual Results

After pressing the Facebook login button in the application, it gets forwarded to WebView with a button to 'Log in with the Facebook App', it also automatically asks to "Open this page in 'Facebook'"? Facebook app then says "you're already logged in.. Would you like to continue?" with a 'continue' button. Once the 'Continue' button is pressed, it returns to WebView with 'Log in with the Facebook app' which again takes you to app and then to webview and then to app...

Steps to Reproduce

We've reproed this on both iOS12 and iOS11. iOS14 seems to be only using webview, and not forwarding to app. iOS13 we have not tested.

Bug is also tracked by Facebook at https://developers.facebook.com/support/bugs/436228210835738/

ppansy commented 3 years ago

Hi @SeriouslySam, thank you for reporting this issue! Could you please provide the app name?

SeriouslySam commented 3 years ago

App is Best Fiends (https://apps.apple.com/us/app/best-fiends-puzzle-adventure/id868013618)

ming060 commented 3 years ago

I had a similar issue when I import AppsFlyer SDK into my project.

I follow the steps below to fix it. https://github.com/AppsFlyerSDK/appsflyer-unity-plugin/blob/master/docs/iOS-Swizzling-Guide.md

Related post on stackoverflow: https://stackoverflow.com/questions/35100809/unity-facebook-sdk-ios-9-2-not-returning-to-app

ppansy commented 3 years ago

@SeriouslySam Can you confirm that the same code works for previous SDK versions? If not you can try to check if you have any conflicting libraries as @ming060 suggested.

SeriouslySam commented 3 years ago

Thank you @ming060 , Appsflyer Swizzling was indeed the issue for us. After I turned that on, the login works again normally.

LongLostPenPal commented 3 years ago

Thank you @ming060 , Appsflyer Swizzling was indeed the issue for us. After I turned that on, the login works again normally.

I had a similar issue, but I'm not using AppsFlyer. My situation : Unity Editor Version: 2019.2.21f Unity SDK Version: 9.0.0 when click FB login button in game , if user has login in WebView , it has a 'continue' button in WebView. Once the 'Continue' button is pressed user will jump back to game but FB.IsLoggedIn is false in FB login callback at this time。Login gets stuck in loop if user not login in WebView。 i use FB.LogInWithReadPermissions to login, not limit mode. All works well for previous SDK versions ( 8.1.1) . help please

kaninhot004 commented 3 years ago

Thank you @ming060 , Appsflyer Swizzling was indeed the issue for us. After I turned that on, the login works again normally.

I had a similar issue, but I'm not using AppsFlyer. My situation : Unity Editor Version: 2019.2.21f Unity SDK Version: 9.0.0 when click FB login button in game , if user has login in WebView , it has a 'continue' button in WebView. Once the 'Continue' button is pressed user will jump back to game but FB.IsLoggedIn is false in FB login callback at this time。Login gets stuck in loop if user not login in WebView。 i use FB.LogInWithReadPermissions to login, not limit mode. All works well for previous SDK versions ( 8.1.1) . help please

Problem still there. Unity 2019.4.30f1 Unity Facebook SDK 11.0.0