简体   繁体   中英

Facebook Unity SDK AutoLogin?

Using version 4.3.3f1 of the Facebook plugin for Unity. Noticing a bit of a bug which is a bit of an annoyance at the moment.

Once the user has logged in, and accepted our permissions, the game continues and posts as desired. However if the game closes and then restarts, the user has to log in again.

I m not calling the log in function when we start up again, why? because that causes the momentary app switch which looks horrible and is jarring. The tooltips seem to suggest that the Init should attempt to restart with valid session data. However prior to and after calling that init function, the Access token seems to be blank. So there is no automatic login occurring.

I've tried setting that status flag to true in both the settings object, and by init via code. Neither seem to make a difference.

Is there something I'm missing to get this working?

When app is force quit, the session is cached, and the cached token remains valid. Facebook Login session should not expire until you force logout, quit session from your application (or) logout from Facebook application if you installed in your mobile. Better to logout from the app when user Quit or pressing the home button.

Try to have logout option inside your game and debug it, Remove logout option once you clear with this .. You may get better idea.

I've been using the Unity Facebook SDK and when I leave and return to the app it does remember that I've logged in. I simply check FB.IsLoggedIn which returns true and I skip over my login process. I only call FB.Login("email,publish_actions", LoginCallback); when FB.IsLoggedIn is false and they push my "Facebook Login" button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM