FB.Logout() 在 Facebook UnitySDK 中不起作用 [英] FB.Logout() not working in Facebook UnitySDK
问题描述
我已成功使用 FB.Login
功能登录 FB.现在我想退出:
I've managed to successfully log in FB using FB.Login
function. Now I want to log out:
FB.Logout();
Debug.Log("FB IS LOGGED IN " + FB.IsLoggedIn);
我希望上面的代码将 FB.IsLoggedIn
的值打印为 false,并在下一个 FB.Login
时要求我提供登录名和密码.
I am expecting the above code to print the value of FB.IsLoggedIn
as false and to ask me for a login and password on the next FB.Login
.
事实上,FB.IsLoggedIn
的值是真的,我没有被注销:下次调用 FB.Login
不会要求输入密码,而我没有当我在浏览器中打开 Facebook 网站时被注销.
In fact the value of FB.IsLoggedIn
is true and I am not being logged out: next call to FB.Login
does not ask for password and I am not being logged out when I open facebook site in my browser.
我也尝试使用未记录的请求 https://www.facebook.com/logout.php?next=[YourAppURL]&access_token=[ValidAccessToken]
但它没有对我没有任何影响.
I've also tried to use the undocumented request to https://www.facebook.com/logout.php?next=[YourAppURL]&access_token=[ValidAccessToken]
but it didn't make any effect for me.
如何在我的独立 Unity 应用程序中将用户从 Facebook 注销?
How can I log the user out of facebook in my standalone unity application?
实际上我需要的是用不同的登录名和密码登录.
也许我可以以某种方式使访问令牌无效,这会导致 FB 再次要求我提供登录名和密码?
Maybe I can invalidate the access token somehow which will cause the FB to ask me for login and password again?
非常感谢任何帮助.
SDK 版本:5.0.1
SDK version: 5.0.1
构建版本:140401.725cc2ecbc9002a
Build version: 140401.725cc2ecbc9002a
Unity 版本 4.3.3f1 (c8ca9b6b9936)
Unity Version 4.3.3f1 (c8ca9b6b9936)
推荐答案
我不确定它是否正确,但为什么不做一些 while 循环?
I'm not sure if it is correct but why not just do some while loop?
IEnumerator FBLogout (){
FB.Logout ();
while (FB.IsLoggedIn){
print ("Logging Out");
yield return null;
}
print ("Logout Successful");
}
这篇关于FB.Logout() 在 Facebook UnitySDK 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!