firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
825 stars 428 forks source link

Problem with Facebook SDK and Invite SDK #75

Closed comtaler closed 7 years ago

comtaler commented 7 years ago

I am experiencing the same problem as reported in issue #32 with the latest SDK. After connecting to facebook, it stays on the browser with a blank page and it does not return.

Unity version: 5.5.1p2 Facebook SDK version: 7.9.4 Invite SDK version: 3.0.1

I tested it with the sample invite project. Here is the console log:

2017-04-07 11:02:39.611 appname[337:45401] -> registered mono modules 0x100dba2f0
-> applicationDidFinishLaunching()
2017-04-07 11:02:39.781 appname[337:45401] Metal GPU Frame Capture Enabled
2017-04-07 11:02:39.781 appname[337:45401] Metal API Validation Disabled
-> applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Init: screen size 1080x1920
Initializing Metal device caps: Apple A8 GPU
Initialize engine version: 5.5.1p2 (72bb63a39d55)
UnloadTime: 1.119500 ms
Setting up firebase...
UIHandler:DebugLog(String)
UIHandler:InitializeFirebase()
UIHandler:Start()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

2017-04-07 11:02:42.400 appname[337] <Notice> [Firebase/Analytics][I-ACS023007] Firebase Analytics v.3700000 started
2017-04-07 11:02:42.405 appname[337] <Notice> [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2017-04-07 11:02:42.408 appname[337] <Notice> [Firebase/Analytics][I-ACS003007] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
2017-04-07 11:02:42.441 appname[337] <Warning> [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
2017-04-07 11:02:42.460 appname[337] <Notice> [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
Invites initialized
UIHandler:DebugLog(String)
UIHandler:Start()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Using Facebook Unity SDK v7.9.4 with FBiOSSDK/4.17.0
Facebook.Unity.CompiledFacebookLoader:Start()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

No Invite or Deep Link received on start up
UIHandler:DebugLog(String)
Firebase.Invites.Listener:TrySendCachedMessage()
Firebase.AppUtil:PollCallbacks()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

-> applicationWillResignActive()
2017-04-07 11:03:07.470 appname[337:45401] DEBUG: OpenURL(fb1318350838212620://authorize/#state=%7B%22challenge%22%3A%223tw1qqHVuUAvW8bcpDy29vayqGk%253D%22%2C%220_auth_logger_id%22%3A%22ED7D5F5D-2919-4E10-8CBC-3F2250B9628E%22%2C%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A%22sfvc_auth%22%7D&granted_scopes=user_friends%2Cemail%2Ccontact_email%2Cpublish_actions%2Cpublic_profile&denied_scopes=&signed_request=<signed request code>
OpenURL(fb1318350838212620://authorize/#state=%7B%22challenge%22%3A%223tw1qqHVuUAvW8bcpDy29vayqGk%253D%22%2C%220_auth_logger_id%22%3A%22ED7D5F5D-2919-4E10-8CBC-3F2250B9628E%22%2C%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A%22sfvc_auth%22%7D&granted_scopes=user_friends%2Cemail%2Ccontact_email%2Cpublish_actions%2Cpublic_profile&denied_scopes=&signed_request=<signed request code>

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

2017-04-07 11:03:07.480 appname[337:45401] DEBUG: Method not cached for class FIRA_UnityAppController-1491588162408 selector application:openURL:options:.
Method not cached for class FIRA_UnityAppController-1491588162408 selector application:openURL:options:.

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

-> applicationDidBecomeActive()
Fetch Pending Invites
Firebase.Invites.FirebaseInvitesHandler:OnApplicationFocus(Boolean)

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
comtaler commented 7 years ago

Any update on this?

One more piece of info: it happens on both iOS 9 and iOS 10.

BoaNeo commented 7 years ago

Anything? I have the same issue... FB redirects to blank page, no errors or warning in the log and no indication that anything went wrong, but it's not working. I've been through every trick on SO with no luck.

stewartmiles commented 7 years ago

Looks like we missed this message, sorry about that. From my response on https://developers.facebook.com/bugs/992759727521507/

"We (Firebase / FPL at Google) found the issue today. It turns out that Unity's AppDelegate doesn't implement the new openURL selector but we swizzle it in (add it to the app delegate) on initialization. This results in the URL being handled by our openURL method which doesn't call Unity's legacy openURL selector and hence notify the Facebook SDK that a sign-in in complete. We'll cook up a workaround. In the meantime you can "fix" this by adding the following to UnityAppController.mm:

We have a fix lined up and are running through QA at the moment but this workaround should be fine until then.

BoaNeo commented 7 years ago

Fantastic, thanks... This has been driving me nuts!

That post on FB must've been the only "blank screen FB login" question I haven't stumbled upon in my search :)...

/Niels

On 28 Apr 2017, at 16:13 , Stewart Miles notifications@github.com wrote:

Looks like we missed this message, sorry about that. From my response on https://developers.facebook.com/bugs/992759727521507/ https://developers.facebook.com/bugs/992759727521507/ "We (Firebase / FPL at Google) found the issue today. It turns out that Unity's AppDelegate doesn't implement the new openURL selector but we swizzle it in (add it to the app delegate) on initialization. This results in the URL being handled by our openURL method which doesn't call Unity's legacy openURL selector and hence notify the Facebook SDK that a sign-in in complete. We'll cook up a workaround. In the meantime you can "fix" this by adding the following to UnityAppController.mm:

(BOOL)application:(UIApplication )app openURL:(NSURL )url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> )options { NSString sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey]; id annotation = options[UIApplicationOpenURLOptionsAnnotationKey]; return [self application:app openURL:url sourceApplication:sourceApplication annotation:annotation]; } " We have a fix lined up and are running through QA at the moment but this workaround should be fine until then.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-unity/issues/75#issuecomment-298008911, or mute the thread https://github.com/notifications/unsubscribe-auth/ACjDHtPGf0xNvwkN8wYXs4x2MOleCotVks5r0fPugaJpZM4M3OC5.

jonsimantov commented 7 years ago

We have released version 3.0.2 of the Firebase Unity SDK, which fixes this issue. You can view the release notes and download the new version from http://firebase.google.com/docs/unity/setup.