简体   繁体   English

适用于Android的Unity Facebook SDK。 应用不断询问权限

[英]Unity Facebook SDK for Android. App keeps asking permissions

The problem is that when the app is requesting permissions you get this popup but if you click ok nothing happens and this popup keeps coming up as if it does not get user permission. 问题在于,当应用程序请求权限时,您会收到此弹出窗口,但是如果单击“确定”,则不会发生任何事情,并且此弹出窗口会继续显示,好像没有用户权限一样。

If I sign the app as a debug user through these settings it DOES WORK 如果我通过这些设置将应用程序签名为调试用户,则它可以正常工作

在此处输入图片说明

But obviously for the final build I have to sign the app with my normal alias. 但是很显然,对于最终版本,我必须使用常规别名对应用程序进行签名。 What could the problem be? 可能是什么问题?

I also found out that the debug hashkey keeps changing when I change between keystores and it could be an openssl problem. 我还发现,当我在密钥库之间进行更改时,调试哈希键会不断更改,这可能是一个opensl问题。 I get a different key from Mac to Win and a different key if I get it from the Facebook settings or the -keytool command. 从Mac到Win,我得到了一个不同的密钥,如果从Facebook设置或-keytool命令得到了,则得到一个不同的密钥。 Is there a way to know the actual hashkey? 有没有办法知道实际的哈希键?

You need to add all the hashkeys that you're gonna use when signing the app to the FacebookApp settings page. 您需要将在将应用程序签名时要使用的所有哈希键添加到FacebookApp设置页面。 You can set up more than one and you'll need this if you're gonna sign the app with debug keys and release keys. 您可以设置多个,如果要使用调试键和释放键对应用程序进行签名,则需要此设置。

Debug keys may differ from machine to machine so it's better to just distribute the keystore with your Unity3D project and use the same one everywhere you build the project. 调试密钥可能因计算机而异,因此最好随Unity3D项目一起分发密钥库,并在构建项目的任何地方都使用相同的密钥库。

If you don't want to distribute the release keys you may want to consider setting up a build machine. 如果您不想分发发行密钥,则可能需要考虑设置构建机器。

To get the hashes for a keystore you need to run: 要获取密钥库的哈希,您需要运行:

keytool -exportcert -alias keyalias -keystore path_to_keystore | openssl sha1 -binary | openssl base64

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

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