question

Koh Siang Leng avatar image
Koh Siang Leng asked

Facebook authentication working on Android but not on iOS,Playfab Facebook login on iOS is not working

Hi, we have setup my unity game with this

https://docs.microsoft.com/en-us/gaming/playfab/features/authentication/platform-specific-authentication/facebook-unity

and what we want to do, is
1) new user install game, register an account using facebook

2) close the game

3) open the game again, detect if playe has a registered facebook account, if yes, go to game scene.

----

On Android, our game will auto detect that player has a registered facebook account and go to game scene.

But iOS will just hang at the detection screen. Is there anything I am missing?

----


While troubleshooting, we also test another build that has post process in case it is not added via playfab.
It is also not working.

#if UNITY_IOS
using System.Collections;
using System.IO;

using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;

using UnityEditor.iOS.Xcode;

public class PostProcessor
{
    [PostProcessBuild]
    public static void UpdateXcodePlist (BuildTarget buildTarget, string pathToBuiltProject)
    {
        if (buildTarget == BuildTarget.iOS)
        {

            // Get plist
            string plistPath = pathToBuiltProject + "/Info.plist";
            PlistDocument plist = new PlistDocument();
            plist.ReadFromString (File.ReadAllText (plistPath));

            // Get root
            PlistElementDict rootDict = plist.root;

            // Change value of CFBundleVersion in Xcode plist
            var fbClientTokenKey = "FacebookClientToken";
            var fbClientTokenValue = "d683c822667f49b6501ce93775c69419";
            rootDict.SetString (fbClientTokenKey, fbClientTokenValue);

            // Write to file
            File.WriteAllText (plistPath, plist.WriteToString ());
        }
    } // public static void UpdateXcodePlist
} // public class PostProcessor
#endif // Platform check

Is there anything we are missing? Do advise. Thanks!

,

Hi, we have setup my unity game with this

https://docs.microsoft.com/en-us/gaming/playfab/features/authentication/platform-specific-authentication/facebook-unity

and what we want to do, is
1) new user install game, register an account using facebook

2) close the game

3) open the game again, detect if playe has a registered facebook account, if yes, go to game scene.

But this only works on Android. and not on iOS.
Our game will auto detect that player has a registered facebook account and go to game scene.

But iOS will just hand at the detection screen.

Is there anything I am missing?

While troubleshooting, we also test another build that has post process in case it is not added via playfab.
It is also not working.

#if UNITY_IOS
using System.Collections;
using System.IO;

using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;

using UnityEditor.iOS.Xcode;

public class PostProcessor
{
    [PostProcessBuild]
    public static void UpdateXcodePlist (BuildTarget buildTarget, string pathToBuiltProject)
    {
        if (buildTarget == BuildTarget.iOS)
        {

            // Get plist
            string plistPath = pathToBuiltProject + "/Info.plist";
            PlistDocument plist = new PlistDocument();
            plist.ReadFromString (File.ReadAllText (plistPath));

            // Get root
            PlistElementDict rootDict = plist.root;

            // Change value of CFBundleVersion in Xcode plist
            var fbClientTokenKey = "FacebookClientToken";
            var fbClientTokenValue = "d683c822667f49b6501ce93775c69419";
            rootDict.SetString (fbClientTokenKey, fbClientTokenValue);

            // Write to file
            File.WriteAllText (plistPath, plist.WriteToString ());
        }
    } // public static void UpdateXcodePlist
} // public class PostProcessor
#endif // Platform check

Authentication
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JayZuo avatar image JayZuo ♦ commented ·

Could you please share more details about how you detect if player has a registered Facebook account? As your code works on Android but not iOS, it seems more like a Facebook Unity SDK issue.

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.