Facebook login stuck in loop between Safari and Facebook App

Hi all,

When I use my app (built with version 2020.3582) to login with Facebook, I’m stuck in a loop between Facebook in Safari and the Facebook app, and can never login, I can only cancel to go back to my game:

  • When I try to login with my app I get the dialog asking if I want to sign in with facebook.
  • I click continue and arrive to Facebook in Safari with a dialog that says "Open this page in “Facebook”?
  • I click open and in the Facebook app I accept and click continue.
  • I’m sent back to Facebook in Safari with a button that says “Log in with the Facebook app”, if I click it, I get the"Open this page in “Facebook” dialog which sends me to the Facebook app and the loop continues in this way.

I’ve noticed that if I go to Facebook.com in Safari and I login manually, then when I try to login via my app, it just goes to Safari, I accept there and it works (I’m never sent to the Facebook app).

I’ve read that this is an issue that is happening in iOS13 with other apps also.

Does anybody know a workaround to fix this?

Thanks!

Jorge

Can you post your FB integration code? Which plugin are you using, too?

Thank you, Troy.

I’m using the v4a plugin: [“plugin.facebook.v4a”] = { publisherId = “com.coronalabs”, },

and this is the rest:

iphone =
{
    xcassets = "Images.xcassets",
	plist =
	{   
     GADApplicationIdentifier = "ca-app-pub-XXXXXXX",
    CFBundleLocalizations = 
  {
    "English",
    "Spanish"
  },
        NSAppTransportSecurity = { NSAllowsArbitraryLoads=true }, 
        UIStatusBarHidden = true,
		UIAppFonts =                         
		{
			"kenpixel_mini_square.ttf", "Arcade.ttf",

		},
        UILaunchStoryboardName = "LaunchScreen", 

        FacebookAppID = myFacebookAppID,
        CFBundleURLTypes =
        {
            {CFBundleURLSchemes = {"fb" .. myFacebookAppID,}}
        },
        -- Whitelist Facebook apps
        LSApplicationQueriesSchemes =
        {
            "fb",  -- Needed for the facebook-v4.isFacebookAppEnabled() API
            "fbapi",
            "fbauth2",
            "fb-messenger-api",
            "fbshareextension",
        },
	},
},

Please let me know if you want to see something else on my code.

Jorge

FYI, I replaced my login code with the sample code from this page: https://docs.coronalabs.com/plugin/facebook-v4a/init.html

and the same issue still happens.

Jorge

Download my game at playthebible.com, the “GenesisTrivia” version and tell me if my FB login functionality does what you’d like or not. If it does, then this will save us time and I can share the code.

1 Like

Hi Troy, your game does login with no issues!
If you could share the portion of your Facebook login code, I would really appreciate it.

Thank you so much!

Jorge

I sent you a private message along with the code; I didn’t post it here, because it’s not publicly suitable and there is a lot of cleanup to do. If you use what works, perhaps you can post a cleaned up version for others here to benefit? It’s been tested and working to allow more than 100,000 FB users login.

1 Like

Thank you so much, Troy! I really, really appreciate it! :slight_smile:

1 Like

So, I found the problem in my app’s build.settings.
For whatever reason this line is conflicting with Facebook login:

[‘plugin.appodeal.GoogleAdMob’] = { publisherId = ‘com.coronalabs’ },

I don’t know if this because of an issue with my AdMob account or if this plugin is incompatible with the facebook plugin, but if I disable that line, my app’s Facebook login works just fine.

Really weird bug. If I find out more, I’ll post it here.