facebook / facebook-sdk-for-unity

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

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

Open Cptweirdo opened 3 years ago

Cptweirdo 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

Log into the game using facebook gaming login via the Facebook app.

Expected Results

User taps the login button, gets a propmt to switch to the Facebook app. On confirmation user is returned to the app where login success callback is executed.

Actual Results

On confirming login in the facebook app, user is returned the our app, but neither success nor error callbacks are triggered.

Steps to Reproduce

Code Samples & Details

Our issue seems to be similar to these issues:

However suggested fix to enable the iOS swizzling for the AppsFlyer SDK does not solve problems for all the users.

Here's a log of the error:

-> applicationWillResignActive()
2021-04-21 08:22:35.044787+0200 footballmanager[1063:508071] swizzled applicationDidBecomeActive
-> applicationDidBecomeActive()
-> applicationWillResignActive()
2021-04-21 08:22:39.143466+0200 footballmanager[1063:508071] swizzled applicationDidEnterBackground
-> applicationDidEnterBackground()
-> applicationWillEnterForeground()
2021-04-21 08:22:48.599457+0200 footballmanager[1063:508071] swizzled openURL
2021-04-21 08:22:48.956194+0200 footballmanager[1063:510290] 7.5.0 - [Firebase/Analytics][I-ACS023000] Deep Link Web URL query is empty
2021-04-21 08:22:48.988706+0200 footballmanager[1063:508289] [connection] nw_read_request_report [C7] Receive failed with error "Software caused connection abort"
2021-04-21 08:22:48.998704+0200 footballmanager[1063:508289] [connection] nw_read_request_report [C4] Receive failed with error "Software caused connection abort"
2021-04-21 08:22:49.004311+0200 footballmanager[1063:508289] Connection 7: encountered error(1:53)
2021-04-21 08:22:49.007265+0200 footballmanager[1063:508289] Connection 7: received failure notification
2021-04-21 08:22:49.008679+0200 footballmanager[1063:508289] [connection] nw_connection_copy_connected_local_endpoint [C7] Connection has no local endpoint
2021-04-21 08:22:49.010444+0200 footballmanager[1063:508289] Connection 4: encountered error(1:53)
2021-04-21 08:22:49.012331+0200 footballmanager[1063:508289] Connection 4: received failure notification
2021-04-21 08:22:49.013514+0200 footballmanager[1063:508289] [connection] nw_connection_copy_connected_local_endpoint [C4] Connection has no local endpoint
2021-04-21 08:22:49.016235+0200 footballmanager[1063:508289] Connection 8: received failure notification
2021-04-21 08:22:49.018139+0200 footballmanager[1063:508289] [connection] nw_flow_add_write_request [C8.1.1 35.241.52.229:443 failed channel-flow (satisfied (Path is satisfied), interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2021-04-21 08:22:49.018329+0200 footballmanager[1063:508289] [connection] nw_write_request_report [C8] Send failed with error "Socket is not connected"
2021-04-21 08:22:49.130966+0200 footballmanager[1063:508071] swizzled applicationDidBecomeActive
-> applicationDidBecomeActive()
AppsFlyer_Unity_v6.2.2 onAppOpenAttribution called

2021-04-21 08:22:49.650903+0200 footballmanager[1063:508289] [tcp] tcp_input [C11.1.1:3] flags=[R] seq=3224266975, ack=0, win=0 state=CLOSED rcv_nxt=3224266975, snd_una=4145637851
2021-04-21 08:22:49.652027+0200 footballmanager[1063:509853] [tcp] tcp_input [C11.1.1:3] flags=[R] seq=3224266975, ack=0, win=0 state=CLOSED rcv_nxt=3224266975, snd_una=4145637851
Uploading Crash Report
Exception: Login failed
FBError => An unknown error has occurred.  // <- "An unknown error has occurred" is the error message returned from the FB SDK
ppansy commented 3 years ago

Hey, from the description "neither success nor error callbacks are triggered", but from the log it seems like a FBError was returned. Do you mind confirming the behavior? thanks

legoritma commented 3 years ago

We're facing same issue, it probably caused by Facebook gaming. Our Facebook contact informed us they're internally investigating in this issue (I don't have any public issue or detail link).

EllieTellie commented 3 years ago

Likewise. The callback just says unknown error on the callback. FB.LogInWithReadPermissions("gaming_profile", "user_friends", Callback);

IgorGalimski commented 3 years ago

Do you use Appsflyer? If yes - use swizzling for it

EllieTellie commented 3 years ago

Do you use Appsflyer? If yes - use swizzling for it

We do not use AppsFlyer, but we do use a lot of other SDKs. Ironsource, Firebase, Amplitude, Adjust and the list goes on.

Some users are still experiencing not being able to login.

IgorGalimski commented 3 years ago

@EllieTellie Make a search in you project to AppDelegateListener You need to merge all AppDelegateListeners in one

Screen Shot 2021-05-05 at 08 43 54
EllieTellie commented 3 years ago

Ok yes, we do have UnityRegisterAppDelegateListener(...) and an SDK which is overriding UnityAppController and maybe messing with this. Thanks a lot @IgorGalimski

legoritma commented 3 years ago

Do you use Appsflyer? If yes - use swizzling for it

I believe this is unrelated. We use appsflyer and swizling enabled. The sytmptoms are different when the problem is swizling, the login callback is never called. In this issue the callback is called with "An unknown error has occurred."

EllieTellie commented 3 years ago

Ok here's what fixed our case (non-appsflyer but similar issue). We had an SDK that implemented a custom AppController to replace the UnityAppController but that custom AppController had an override for continueUserActivity which always returned YES preventing other apps like Facebook from handling it. Simply returning NO and allowing other Apps to handle them fixed it for us.