简体   繁体   English

Facebook SDK 5.0.4适用于Unity,Android,登录失败,正确的哈希密钥

[英]Facebook SDK 5.0.4 for Unity, Android, Login Fails, Correct Hash Key

I think I have the same problem as in this post. 我想我和这篇文章有同样的问题。

I am using Unity4.3.0f4 and Facebook SDK 5.0.4 beta . 我正在使用Unity4.3.0f4Facebook SDK 5.0.4 beta

I use the correct key hash (not the debug one) which I obtained by FB.Android.KeyHash . 我使用FB.Android.KeyHash获得的正确密钥哈希(不是调试密钥)。 On my own device, as well as on BlueStacks emulator, I manage to log in and FB.Feed normally. 在我自己的设备上,以及在BlueStacks模拟器上,我设法正常登录和FB.Feed However, other users that have tested the app cannot login. 但是,已经测试过该应用的其他用户无法登录。 FB.Login("publish_actions", callback) is called, the permission dialog is shown, the user taps OK and then returns to game. FB.Login("publish_actions", callback) ,显示权限对话框,用户点击OK然后返回游戏。 Result.text is then 然后是Result.text

{"is_logged_in":false, "user_id":"", "access_token":"", "access_token_expires_at":"01/01/0001 00:00:00"}

Any idea? 任何想法?

  • ps. PS。 On my phone i have an earlier version of the Facebook app, not the last one. 在我的手机上,我有一个早期版本的Facebook应用程序,而不是最后一个。
  • ps2. PS2。 You can download my app and take part in the beta testing to see the problem yourself. 您可以下载我的应用程序并参与 beta测试以自行查看问题。

Ok, after all the problem was that I was trying to log in while immediately requesting the publish_actions permission, which by the way is NOT needed for FB.Feed() . 好吧,毕竟问题是我在尝试登录时立即请求了publish_actions权限,顺便说一下FB.Feed()不需要。

FB.Login ("publish_actions", AuthCallback); // WRONG!!!!!!

Finally I used 最后我用了

FB.Login ("", AuthCallback); // Ok

and it works properly at last. 它终于正常工作了。

Make sure your test users can see the app. 确保您的测试用户可以看到该应用。

My guess in your app is sandboxed and your test users are not listed on Developer Dashboard. 我在您的应用程序中的猜测是沙盒,并且您的测试用户未在开发人员仪表板上列出。

Either un-sandbox it, or add them as Testers(its in Roles tab) 取消沙箱,或将它们添加为测试人员(在“角色”选项卡中)

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

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