How do I get Facebook User ID?

Get help using Construct 2

Post » Mon Feb 09, 2015 6:10 pm

So I have a Facebook log in on my game. it allows the user to log into my game via FB and stores their information into different variables. So the information I'm currently trying to retrieve is their name and User ID. I can retrieve the name, store into a variable, and display the name via text object no problem. However when i try to store the User ID and display it all I get is NaN. Now if I refresh my game then the User ID will show up fine. But on the first Log in the User ID always comes in as NaN. Anyone else have this issue?

Image
Image
B
34
S
16
G
2
Posts: 185
Reputation: 4,060

Post » Mon Feb 09, 2015 10:42 pm

it may take sometime before it connects to the server, you should also check for "is user logged in"
Read this:
yeah, i really like to say that you should "Read this:"
B
12
S
5
Posts: 138
Reputation: 1,490

Post » Tue Feb 10, 2015 3:45 pm

I've tried it with, On User Log in and Is user logged in still keep getting NaN on the first login. I even tried creating a variable LoggedIn = 0. And upon logging in it changes to 1 and then having another event that says if LoggedIn = 1 then set FBUserID to Facebook.UserID. Still get a NaN result. I've also tried setting it up so that EveryTick FBUserID = Facebook.UserID. That doesn't even work so it's like the User ID isn't even being passed on the first log in whatsoever.
Image
B
34
S
16
G
2
Posts: 185
Reputation: 4,060

Post » Wed Feb 11, 2015 8:47 pm

I haven't made any progress on this and was hoping someone out there has figured out how to store the Facebook User ID into a variable upon first login.
Image
B
34
S
16
G
2
Posts: 185
Reputation: 4,060


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests