Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Understanding Facebook Logic

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Mar 2015 18:41
I'm a little confused as to how FB Logic works. My testing doesn't align with the example code on the help page.

This is the demo code:



So taking the section after initialisation:



This looks like it is looping the program while the FB overlay is in play. However, my tests suggest that the program stops executing until you return from the FB overlay. Is this correct?

Secondly, returning from the FB overlay provides one of two values in my tests...1 for logged in and -1 for cancelled. So I don't understand what this loop is trying to achieve, looping while 0?

If it does serve a purpose, then there is a problem. If you cancel the login, then GetFacebookLoggedIn() = -1 forever, until you log in. FacebookLogout() sets the value to -1 too. So if the user cancels, then tries to log in a second time, this loop will immediately end. you cannot assume you are starting FacebookLogin() with a value of 0.


Can anyone unravel this mystery for me please!

Quidquid latine dictum sit, altum sonatur
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 10th Mar 2015 17:52
The loop is a precaution to catch the few frames between calling the login command and Facebook pausing the AppGameKit app, since Facebook runs in a separate activity. When you call FacebookLogin again the GetFacebookLoggedIn command immediately resets to 0, so it should work, but I'll make FacebookLogout also set it to 0 so it is more obvious what state it is in.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Mar 2015 18:11
Excellent, that lines up with my tests, and the info about checking for zero on the way back is very useful thanks. Last night I added some audible pings to work out what was happening.

Quidquid latine dictum sit, altum sonatur

Login to post a reply

Server time is: 2024-11-25 18:34:52
Your offset time is: 2024-11-25 18:34:52