0
votes

I am testing Unity 4.3 with Unity Facebook SDK 4.3.4 and have everything running but it seems to always return a Test User and not my actual Facebook Login.

Using the Facebook InteractiveConsole Scene, after Logging in I see:

Facebook Dll: Loaded Successfully
UserId: 0
IsLoggedIn: True
AccessToken: abcdefghijklmnopqrstuvwxyz

Running FriendSmash...Same thing just returns the UserID: 0 and No Name

How do I tell the SDK to actually log ME in and not just a test user?

I can't seem to find anything, I tried setting the App to Not in Sandbox mode

I think I am probably missing something obvious.

Any help?

3
Did you put in your Facebook app id? Also is this from within the Unity Editor? There's no actual login from within the editor.Brian Jew
Yes I have the App ID in and YES I was trying form the editor...after a text search through all the code for abc...z I figured out that the editor wasn't logging in and just spitting out 0 and abc..zRyan Jones
Testing Android now with the Inspector to see what it is actually returning for userid and AccessToken because for friendsmash it just gave me the same Welcome Smasher screen....Ryan Jones
OK..Inspector actually worked...it logged me in...Ryan Jones
Sorry I meant InteractiveConsole...not InspectorRyan Jones

3 Answers

4
votes

You can't actually log in and get real data in the editor yet. We just return some placeholder data, this is what you are seeing. This is a feature we are currently working on. But for now you will need to run on the iOS simulator, an iOS device, an Android device, or put your game onto Facebook canvas to get a working login.

0
votes

I was trying to run the game from the Editor and the Editor does not actually log you in. It just defaults to USERID:0 and Access Token: abcdefghijklmnopqrstuvwxyz

I compiled the InteractiveConsole Scene to the android device and it gave me the proper login. Check my friendslist and all was good.

Still haven't checked out why FriendSmash doesn't read my name but that's another issue.

Thanks Brian!

0
votes

Alternatively, you can create a script that contains an access token variable that you set by hand. Get the access token from the Facebook Graph API explorer, put it into this variable and pass it into your FB calls. This allows you to log into Facebook when running in the Unity editor.