Facebook-sdk-for-unity: iOS: "Open this page in Facebook?" popup blocks login

Created on 13 Jul 2020  ·  6Comments  ·  Source: facebook/facebook-sdk-for-unity

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

  • Unity Editor Version: 2019.3.0f3
  • Unity SDK Version: 7.19.2
  • Installation Platform & Verison: iOS version 13.5.1

Goals

Log into the game with Facebook.

Expected Results

The user is able to go through the login flow.

Actual Results

When running on an iPhone X, after calling FB.LogInWithReadPermissions and tapping "Continue" on the prompt, this screen comes up:

IMG_1972

I'm not able to dismiss the "Open this page in Facebook?" popup, either by tapping "Cancel," "Open," or outside of the popup. The browser's top-left "Cancel" button works fine. Uninstalling and reinstalling the Facebook app fixed the issue for one run, but for subsequent runs, the issue returned.

This issue doesn't occur on an iPad Pro with iOS 13.5.1 or an iPad Air with iOS 12.4.7.

Another issue is that the keyboard isn't opened for text input in websites opened by the game - for example, by the Google Sign-in SDK. For some reason, this is fixed on the iPhone after uninstalling the Facebook app (and broken after reinstalling it)! However, this issue occurs on the iPad regardless of if the Facebook app is installed or not.

Steps to Reproduce

Edit: successfully reproduced:

  1. Create a new Unity project and add SDK 7.19.2
  2. Remove Play Services Resolver
  3. Add Google Sign-In 1.0.4 without Parse and Play Services Resolver
  4. Add External Dependency Manager 1.2.156 and add registry when prompted
  5. Create a script on the camera and in Start, call FB.Init, then FB.LoginWithReadPermissions
  6. Build for iOS with the device SDK
  7. In the Podfile, change GoogleSignIn version to < 5.0.0
  8. Run on an iPhone X with iOS 13.5.1 and the Facebook app (don't have access to any other iPhones)

Code Samples & Details

Link to reproduction.

Code:

public class TestScript : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        FB.Init(() => {
            FB.LogInWithReadPermissions(
                new List<string>() { "public_profile", "email", "user_friends", "user_posts" }, 
                loginResult => {

                }
            );
        });
    }

    // Update is called once per frame
    void Update()
    {

    }
}

Output:

2020-07-13 10:45:05.042142-0400 FacebookSandbox[11263:4698992] Built from '2019.3/staging' branch, Version '2019.3.0f3 (6c9e2bfd6f81)', Build type 'Release', Scripting Backend 'il2cpp'
-> applicationDidFinishLaunching()
2020-07-13 10:45:05.608167-0400 FacebookSandbox[11263:4698992] FBSDKLog: starting with Graph API v2.4, GET requests for /1184331378431008/model_asset should contain an explicit "fields" parameter
-> applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A11 GPU
Initialize engine version: 2019.3.0f3 (6c9e2bfd6f81)
2020-07-13 10:45:05.630826-0400 FacebookSandbox[11263:4699191] [] tcp_input [C2.1:3] flags=[R] seq=4067646681, ack=0, win=0 state=CLOSED rcv_nxt=4067646681, snd_una=952914416
2020-07-13 10:45:05.631434-0400 FacebookSandbox[11263:4699191] [] tcp_input [C2.1:3] flags=[R] seq=4067646681, ack=0, win=0 state=CLOSED rcv_nxt=4067646681, snd_una=952914416
2020-07-13 10:45:05.633674-0400 FacebookSandbox[11263:4699191] [] tcp_input [C1.1:3] flags=[R] seq=1622058020, ack=0, win=0 state=CLOSED rcv_nxt=1622058020, snd_una=3506061178
2020-07-13 10:45:05.633732-0400 FacebookSandbox[11263:4699191] [] tcp_input [C1.1:3] flags=[R] seq=1622058020, ack=0, win=0 state=CLOSED rcv_nxt=1622058020, snd_una=3506061178
2020-07-13 10:45:06.342714-0400 FacebookSandbox[11263:4698992] Unbalanced calls to begin/end appearance transitions for <SplashScreenController: 0x15dd05b40>.
2020-07-13 10:45:06.359559-0400 FacebookSandbox[11263:4699195] [] tcp_input [C3.1:3] flags=[R] seq=2077033276, ack=0, win=0 state=CLOSED rcv_nxt=2077033276, snd_una=616266740
2020-07-13 10:45:06.361976-0400 FacebookSandbox[11263:4699195] [] tcp_input [C3.1:3] flags=[R] seq=2077033276, ack=0, win=0 state=CLOSED rcv_nxt=2077033276, snd_una=616266740
2020-07-13 10:45:06.365490-0400 FacebookSandbox[11263:4699195] [] tcp_input [C6.1:3] flags=[R] seq=2625008296, ack=0, win=0 state=CLOSED rcv_nxt=2625008296, snd_una=1507674903
2020-07-13 10:45:06.365527-0400 FacebookSandbox[11263:4699195] [] tcp_input [C6.1:3] flags=[R] seq=2625008296, ack=0, win=0 state=CLOSED rcv_nxt=2625008296, snd_una=1507674903
2020-07-13 10:45:06.901348-0400 FacebookSandbox[11263:4699192] [] tcp_input [C5.1:3] flags=[R] seq=1080860623, ack=0, win=0 state=CLOSED rcv_nxt=1080860623, snd_una=3380130027
2020-07-13 10:45:06.905260-0400 FacebookSandbox[11263:4699192] [] tcp_input [C5.1:3] flags=[R] seq=1080860623, ack=0, win=0 state=CLOSED rcv_nxt=1080860623, snd_una=3380130027
UnloadTime: 0.302667 ms
Using Facebook Unity SDK v7.19.2 with FBiOSSDK/6.5.2
Facebook.Unity.CompiledFacebookLoader:Start()

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

-> applicationWillResignActive()
-> applicationDidBecomeActive()
bug

Most helpful comment

I encounter the same bug in many iPhone devices which run iOS 13.
My code is similar to @michelleran, I can't click the the "Open" and "Cancel" in the pop up dialog(You have to logout Facebook in safari first to reproduce this bug).
My game is Cooking Marina and you can download it on Apple Store.
If I compile the project with Xcode 10, the login process is successful but I can't upload build to App Store with Xcode 10.
When I test the login flow in iPad, the login process always complete. This bug only occurs in iPhone with iOS 13.
Hope we have a solution soon.

All 6 comments

Edited with steps to reproduce.

Hi @michelleran, thank you for reporting this issue! Could you please provide the app name?

Are you referring to the name in the Facebook developer dashboard? If so, it's "Cake Game" - it's not published though.

I encounter the same bug in many iPhone devices which run iOS 13.
My code is similar to @michelleran, I can't click the the "Open" and "Cancel" in the pop up dialog(You have to logout Facebook in safari first to reproduce this bug).
My game is Cooking Marina and you can download it on Apple Store.
If I compile the project with Xcode 10, the login process is successful but I can't upload build to App Store with Xcode 10.
When I test the login flow in iPad, the login process always complete. This bug only occurs in iPhone with iOS 13.
Hope we have a solution soon.

@michelleran Thank for the reply. We are working on getting this issue resolved. In the mean time, I've disabled app switching for you app (which means that you will not get the “Open this page in Facebook” dialog) so that you would be able to complete the login process.

Hi, I am having the same problem. Is there any solution for this flow?

Unity Editor Version: 2019.4.23f1
Unity SDK Version: 9.1.0
Installation Platform & Verison: iOS version 14.4.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daCelky picture daCelky  ·  21Comments

SangCrowdstar picture SangCrowdstar  ·  20Comments

CriticalForce picture CriticalForce  ·  21Comments

MartinGonzalez picture MartinGonzalez  ·  29Comments

MoinTom picture MoinTom  ·  22Comments