Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • Bugs /
avatar image
Question by Koh Siang Leng · Oct 26, 2021 at 07:39 AM · Authentication

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

Comment

People who like this

0 Show 1
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jay Zuo ♦ · Oct 26, 2021 at 08:13 AM 0
Share

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 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    Game experiencing issue logging in with steam 1 Answer

    Weird Bug on Login with Email: "Service Unavailable" 1 Answer

    Unable to run client and server UE 4.26 due to DeveloperSecretKey 1 Answer

    Issue with LoginWithGameCenter in Unreal Engine 4 0 Answers

    The checkboxes on the Apple add-on do not work 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges