Sign In Register

How can we help you today?

Start a new topic
Answered

trying to connect & log into facebook

Howdy,


Trying to get some basic integration working. Everything seems to be going ok, Facebook & Gamesparks example scenes work fine, can log into facebook on the test harness scene with my access tokens etc.


However, when I try to follow the basic integration tutorial, this call blows up on me:


new FacebookConnectRequest().SetAccessToken(FB.AccessToken).Send((responses) =>

{

    if ( responses.HasErrors )

    {

        Debug.Log("Could not connect to Facebook" + fbResult.Error);

    }

    else

    {

        Debug.Log("GameSparks Facebook Login Successful");

        UserService.Instance.UpdateInformation();

    }

});


The SetAccessToken().Send() call fails with the following error:


Could not get data from access token: The GSInstance "default" is not initalized. Did you call "void Initialise(IGSPlatform platform);" ?

UnityEngine.Debug:LogError(Object)

FbDebug:Error(String)

Facebook.EditorFacebook:BadAccessToken(String) (at Assets/Plugins/Facebook/Scripts/EditorFacebook.cs:260)

Facebook.EditorFacebook:MockLoginCallback(FBResult) (at Assets/Plugins/Facebook/Scripts/EditorFacebook.cs:249)

Facebook.<Start>c__Iterator0:MoveNext()


I'm sort of at a loss - any ideas?


The facebook authentication dialog pops up fine, but blows up (in the editor) on the above call.


Even stranger, on device, it doesn't throw an exception, but the inner if->else to init the UpdateInformation() call never gets executed.


The only hint that I have is this message that shows in the log:


"SendMessage: object UnityFacebookSDKPlugin does not have receiver for function OnAccessTokenUpdate!"


I'm using the 6.2.2 version of the Facebook SDK - is this an SDK version issue? Not sure what's going on.


Any ideas you have are greatly appreciated.


Best Answer

flarrrrgh. nm i'm an idiot. figured it out. forgot to add the stupid GameSparksUnity component to my scene. So...dumb... ;P



Thought it might be Facebook SDK version related, but just installed an older version (6.1) but get the same problem.

Answer

flarrrrgh. nm i'm an idiot. figured it out. forgot to add the stupid GameSparksUnity component to my scene. So...dumb... ;P