I'm currently working on some lightweight code to correctly wrap usage of the Facebook Unity SDK for some client applications, and I've run into a minor problem, wherein the Facebook Unity SDK docs suggest that I shouldn't be doing what I am. Basically I want to know if what I'm doing is right.
- To preface - the documentation for FB.Logout suggests that a client app should never really need to call it, as it will log the user out of facebook globally, in contradiction of their expectations. (See https://developers.facebook.com/docs/unity/reference/current/FB.Logout)
- In my code when I receive an error from facebook which could mean the token has been invalidated, I ping off a simple request which should always succeed if the user's token is still valid. If this fails, I invoke FB.Logout, because without doing so, calling FB.Login again will simply fail - the user's token will remain the same, and the Login call will succeed.
- Behaviourally everything behaves as I would want - calling FB.Logout just clears the local state and lets me go back to my 'initialised but not logged in' situation.
Basically, I want to know if this is expected behaviour, and whether, contrary to the documentation, this is the correct case for calling FB.Logout.
Cheers, Jeremy