Question

I am using Unity3d 4.3.4f1 with Facebook Unity SDK 5.0.3. (I could not get 5.1 to work... I get errors when I import that package but not with previous packages).

The issue I am having was also present with Facebook Unity SDK 4.3. I thought upgrading might fix it... Maybe it's just a stupid setting somewhere?

Anyway, I am able to log in to my game and play, but NOBODY else can... Had friends try, my wife, a fake Facebook account I made... Doesn't matter if I mark them as testers or not... I've tried making the app available to public or not... Nothing seems to matter... I am the ONLY one that can log in...

I have very simply, a GUI.Button:

if (!FB.IsLoggedIn) {
            //START
            if (GUI.Button(new Rect(Screen.width * 0.55f, Screen.height * 0.7f, Screen.height * 0.2f * (float)1920/700, Screen.height * 0.2f), "", "Enter"))
            {
                if (!FB.IsLoggedIn) {
                    Init.Start();
                }
            }
            return;
        }

I am the ONLY one that can click that button and have something actually happen... For everyone else, clicking the button does NOTHING at all... It just sits there... I can add a debugger that will tell me when the user clicked the button which confirms they are clicking it, but it just sits there... Like, the "Init.Start()" is failing somehow and never getting their "FB.IsLoggedIn" to get marked as true...

Any ideas at all would be MUCH appreciated at this point! I have 6 months worth of development and NOBODY can test it but me... I basically have NO GAME! :(

Was it helpful?

Solution 2

The answer, thanks to @Brian Jew, is in the comments of his answer. I am moving to here to make it easier for others to find:

The answer is quite simple... Init.Start was calling FB.Init but not FB.Login. Here is updated code:

In any script that launches your game, you can put a "start" button:

if (!FB.IsLoggedIn) {
        //START
        if (GUI.Button(new Rect(Screen.width * 0.55f, Screen.height * 0.7f, Screen.height * 0.2f * (float)1920/700, Screen.height * 0.2f), "", "Enter"))
            Init.Start();
        return;
    }

}

Then "Init" is my own custom script that just runs some initial startup stuff. Inside is this:

public static void Start(){
    FB.Init(OnInitComplete, OnHideUnity);
}

private static void OnInitComplete()
{
    dMsg += "FB.Init completed: Is user logged in? " + FB.IsLoggedIn;
    if (!FB.IsLoggedIn) FB.Login();   //<--- Magic login code! :P
    isInit = true;
}

private static void OnHideUnity(bool isGameShown)
{
    dMsg += "Is game showing? " + isGameShown;
}

OTHER TIPS

It's possible that your app isn't shared to the public yet: https://developers.facebook.com/apps/[APP-ID]/review-status/

if so, then it means that other people would not be able to log in since technically they shouldn't have access to it yet.

Also what problems did you run into for 5.1?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top