简体   繁体   English

Facebook Unity SDK自动登录?

[英]Facebook Unity SDK AutoLogin?

Using version 4.3.3f1 of the Facebook plugin for Unity. 使用Unity的Facebook插件4.3.3f1版本。 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. 工具提示似乎建议Init应该尝试使用有效的会话数据重新启动。 However prior to and after calling that init function, the Access token seems to be blank. 但是,在调用该init函数之前和之后,访问令牌似乎为空。 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. 我尝试在设置对象中以及通过代码通过init将状态标志设置为true。 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. 在您强制注销,从应用程序退出会话(或从Facebook应用程序注销)(如果您已安装在手机中)之前,Facebook登录会话应该不会过期。 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. 我一直在使用Unity Facebook SDK,当我离开并返回该应用程序时,它确实记得我已经登录。我只是检查FB.IsLoggedIn ,它返回true ,所以跳过了登录过程。 I only call FB.Login("email,publish_actions", LoginCallback); 我只叫FB.Login("email,publish_actions", LoginCallback); when FB.IsLoggedIn is false and they push my "Facebook Login" button. FB.IsLoggedInfalse ,他们按下我的“ Facebook登录”按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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