0

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! :(

Nicolai Dutka
  • 340
  • 1
  • 4
  • 16

2 Answers2

1

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?

Brian Jew
  • 906
  • 5
  • 5
  • It's definitely shared to public and searchable. Go ahead and look for "Lost Worlds" and you'll see it! – Nicolai Dutka Apr 10 '14 at 21:32
  • The problem with SDK 5.1: http://stackoverflow.com/questions/22848490/internalcompilererror-when-i-import-the-new-facebook-5-1-sdk-into-my-existing-pr/22863625#22863625 – Nicolai Dutka Apr 10 '14 at 21:34
  • I tried searching for it: https://www.facebook.com/appcenter/search?q=Lost%20Worlds is the full name "Rescue Me - The Lost World"? Also I answered your 5.1 problem in the other thread that you linked. – Brian Jew Apr 10 '14 at 21:37
  • FYI, I just now looked in my Facebook Developer Console and checked out the User Stats on the App's Dashboard and it does say 2 users... (Likely me and my alt account). Yet, still nothing happens when anyone clicks the "Enter" button except me... – Nicolai Dutka Apr 10 '14 at 21:40
  • ^^ Hmm, nope, that's not the full app... I haven't submitted for review, it's simply open to public... Show's up right away when I search from the home page but like you, I cannot find it in the app catalog... – Nicolai Dutka Apr 10 '14 at 21:42
  • 1
    btw what does your `Init.Start();` actually do? Do you call FB.Login() at any point? – Brian Jew Apr 10 '14 at 21:45
  • Basically just calling FB.Init... I just added a FB.Login to the 'onInitComplete'.... *fingers crossed* – Nicolai Dutka Apr 10 '14 at 22:11
  • 1
    LOOKS fixed!! Thank you so much @Brian!! This is my "Init.Start()": 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(); isInit = true; } – Nicolai Dutka Apr 10 '14 at 22:15
0

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;
}
Nicolai Dutka
  • 340
  • 1
  • 4
  • 16