Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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

Discussion in 'iOS and tvOS' started by rasmus_unity499, May 12, 2020.

  1. rasmus_unity499

    rasmus_unity499

    Joined:
    Nov 29, 2018
    Posts:
    5
    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:
    https://github.com/facebook/facebook-sdk-for-unity/issues/436

    As I said there, I think the issue is a Unity issue rather than Facebook issue.
     
    ageana likes this.
  2. anatolyV

    anatolyV

    Joined:
    Nov 29, 2014
    Posts:
    63
    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.
     
  3. anatolyV

    anatolyV

    Joined:
    Nov 29, 2014
    Posts:
    63
    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
     
  4. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    212
    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.
     
    Last edited: May 13, 2020
  5. yurykorzun

    yurykorzun

    Joined:
    Oct 29, 2015
    Posts:
    41
    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.
     
  6. rasmus_unity499

    rasmus_unity499

    Joined:
    Nov 29, 2018
    Posts:
    5
    What is the usage of these methods: createSnapshotView and closeSnapshotView? Will there be any issues if those are commented out? @yurykorzun
     
  7. yurykorzun

    yurykorzun

    Joined:
    Oct 29, 2015
    Posts:
    41
    Here is the UnityAppController.mm added by Unity to the XCode project - https://gist.github.com/yurykorzun/4729dc1f1228e5e3eb467bde781dfdff

    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.
     
  8. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    same here, commenting:

    //#define UNITY_SNAPSHOT_VIEW_ON_APPLICATION_PAUSE 1

    which effectively disables createSnapshotView fixes the issue with Unity 2019.3.13
     
    yurykorzun likes this.
  9. yurykorzun

    yurykorzun

    Joined:
    Oct 29, 2015
    Posts:
    41
  10. korober

    korober

    Joined:
    Jan 20, 2015
    Posts:
    14
    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
     
  11. Shaunyowns

    Shaunyowns

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    328
    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?
     
  12. rasmus_unity499

    rasmus_unity499

    Joined:
    Nov 29, 2018
    Posts:
    5
    Hey @Shaunyowns you can check this out here as well: https://github.com/facebook/facebook-sdk-for-unity/issues/436

    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.