facebook / facebook-sdk-for-unity

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

On Login Process, "Open in Facebook" popup causes failure of the login. #545

Open hdemircioglu opened 3 years ago

hdemircioglu 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

What do you want to achieve? Trying to login with read permissions of public_profile, email, user_friends.

Expected Results

What do you expect to happen? After clicking open in Facebook, and giving allowance to the app popup needs to close with success result.

Actual Results

What actually happened? Can you provide a stack trace? After clicking open in Facebook, it launches the app. When I click continue on allowance of the app to login, it turns back to the same page. So, I left with the only option to cancel.

Steps to Reproduce

What are the steps necessary to reproduce this issue? 1- Click Login from the app 2- Select Open in "Open in Facebook popup" 3- Allow app to login by selecting continue, from "Previously logged in to the game. Would you like to continue?"

Code Samples & Details

Please provide a code sample, as well as any additional details, to help us track down the issue. If you can provide a link to a test project that allows us to reproduce the issue, this helps us immensely in both the speed and quality of the fix.

IMG_0002 IMG_0005 IMG_0003

johnny-tictoc commented 3 years ago

This is also happening to us, but on iOS only. We are using v8.0 of the SDK. The SDK seems to keep passing us between Facebook App and the WebView. Uninstalling the Facebook app allows us to successfully login.

step1 step2 step3

legoritma commented 3 years ago

Is your app have AppsFlyer? Your case reminds me #519

johnny-tictoc commented 3 years ago

@legoritma Yes, we are using Appsflyer. I'll try out the fix in that link. Thanks!

hdemircioglu commented 3 years ago

Hi, Thanks for the share. I tried AppsFlyerShouldSwizzle solution. Now, I have that line in the Xcode; image

But, the problem still continues. It does not solve it.

ppansy commented 3 years ago

Hi @hdemircioglu, thanks for reporting. A couple questions to helper us understand your issue:

hdemircioglu commented 3 years ago

Hi @ppansy,

Answers to the questions:

Thanks for the help.

ppansy commented 3 years ago

This seems similar to #546 Can your try out the following fix? https://github.com/facebook/facebook-sdk-for-unity/issues/546#issuecomment-832427152

hdemircioglu commented 3 years ago

image

When I searched the term, I end up with the result in the image. I also double-checked Swizzling condition by logging it in the initialization with the code below and it is logged as "true". My problem looks like not related to the AppDelegateListener. Am I missing something?

        id swizzleFlag = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"AppsFlyerShouldSwizzle"];
        BOOL shouldSwizzle = swizzleFlag ? [swizzleFlag boolValue] : NO;

        NSLog(@"Swizzle: %s", shouldSwizzle ? "true" : "false");

        if(!shouldSwizzle){
            UnityRegisterAppDelegateListener(self);
        }
ppansy commented 3 years ago

From the logs you provided it looks like the issue is with Firebase. Facebook's deep link url get routed to Firebase's listener instead of Facebook's:

Failed to process fb479936132915089://authorize#denied_scopes=&granted_scopes=user_friends%2Cemail%2Copenid%2Cpublic_profile&graph_domain=facebook&nonce=AWUXYnXPl1K0wKAn8Ba3L2Tv5tS9ejoPagxmt0ip9ntBoa_Wiwxas9dNfcrUi4DBoS2UTp2GByQfqvGmzzim5ZdzEvg&signed_request=eHtQ-nZvJ9kibGUUxtNllp0Fq3zfABAIE1vYY27nWow.eyJ1c2VyX2lkIjoiMTAxNTcyNTMxMjM2MDMzMzMiLCJjb2RlIjoiQVFCLUYxWXdBaXlmTkRaWXZLZGZ1dTNjaU1EWGhvVG1OcHFKeWdwN3ItYS1UR1NRZjkxbURUb3ZnVTJZVG5vdVZscGtvQ1hTTTNUV3luV1luWFBPVF9jbGpvOVRFcXhCd2c2SEFUTUZzZGo1aldXY2FEcT Firebase.AppUtil:PollCallbacks() Firebase.Platform.FirebaseHandler:Update()