Facebook Login broken in Unity 2019.3.13f1 but works in 2019.3.7f1

Hey,

It seems Facebook Login has been broken in Unity 2019.3.13f1 but works in 2019.3.7f1. Calling Login will show a login dialog briefly only to disappear but game will still be visible and “paused” like if game is still in the background (clock and notifications-bar is still shown).

I don’t have any particular logs with this because the app doesn’t crash it just stays like that forever. I don’t think this issue has to do with Facebook SDK in particular but rather a change in how some rendering is handled. It’s like there’s an invisible windows overlaying it all.

NOTE:
Also tested in Unity 2020.1, same issue there.

I needed to make a build for simulator (for Facebook review), but 2019.3.7f did have “gfx device initialization” issue and was told it was fixed in 2019.3.10+ so I updated to 2019.3.13f and also tested 2020.1 (because Metal works here) and came upon this problem.

I’m basically here now:
2019.3.7 = Facebook works but not simulator
2020.1 = Simulator works but not Facebook

I’m sorry but I don’t have the time to making a minimum project showcasing this as I spent 12 hours straight trying to figure out what I was doing wrong.

Writing this to see if other have same issue and hopefully someone with less fatigue and more time can provide a repro case and submit.

Issue has been reported here as well:

As I said there, I think the issue is a Unity issue rather than Facebook issue.

1 Like

Same exact issue here. 2019.3.13f1, Facebook SDKs 7.18.0-7.19.2, iOS 13.4.1.
At least your post tells me I could try downgrading Unity a bit.

Can confirm that the issue doesn’t present after downgrading to 2019.3.9f1. No issues downgrading either, just had to delete the package cache from Library

Hello, same issue here with 2019.3.13f1 or 3.11f1 and FB 7.19.2 or 7.18.1

With Unity 2019.3.9f1 and FB 7.18.1 it is ok.

Seems to happened when we are already connected to facebook app. I will try to upgrade FB sdk with 2019.3.9f1.
So much time lost to track issue each time we update Unity or facebook… Really!

Note: Be carefull FB.ShareLink on iOS does not call callback. I use FB.FeedShare instead for iOS. Android is ok.

That’s because UnityAppController.mm closes any presenting views, such as FB login. You can fix it by commenting out createSnapshotView and closeSnapshotView calls in UnityAppController. I hope Unity fixes it in future releases.

What is the usage of these methods: createSnapshotView and closeSnapshotView? Will there be any issues if those are commented out? @yurykorzun

Here is the UnityAppController.mm added by Unity to the XCode project - UnityAppController.mm 2019.3.13 · GitHub

It’s copied from Unity app folder/PlaybackEngines/iOSSupport/Trampoline

You can take a look at two methods - createSnapshotView and removeSnapshotViewController

removeSnapshotViewController is closing any presenting modal views.

We haven’t noticed any issues once we removed them, but I can’t say for sure.

same here, commenting:

//#define UNITY_SNAPSHOT_VIEW_ON_APPLICATION_PAUSE 1

which effectively disables createSnapshotView fixes the issue with Unity 2019.3.13

1 Like

It probably prevents Unity from rendering a black screen when it is paused. I haven’t noticed this in our app when we removed snapshot creation. snapshotViewAfterScreenUpdates: | Apple Developer Documentation

Changing UNITY_SNAPSHOT_VIEW_ON_APPLICATION_PAUSE from 1 to 0 should also work

same issue with Unity 2018.4.23f1, so I’ve back to 2018.4.17f1, now all works with latest facebook’s sdk 7.19.2

Hey everyone,

I’ll chase this up to see if we can find out what’s going on.

Is someone able to bug report this so we can get it tracked?

Hey @Shaunyowns you can check this out here as well: Facebook Login is not working on on iOS Unity 2018.4.22f1 · Issue #436 · facebook/facebook-sdk-for-unity · GitHub

Solution (from thread): “Alternatively if you don’t want to setup a post-processor the UNITY_SNAPSHOT_VIEW_ON_APPLICATION_PAUSE flag can be turned off simply by unticking the “Render extra frame on pause” option in the iOS Player Settings area.”

This should be easy for you guys (Unity) to replicate and fix as it’s very straight forward. Probably you force closes native dialogs (or something) on pause to get a “nice” preview frame.