1

I have looked up on google,stackoverflow,whole internet...But nothing seems to solve this problem. I think I am missing some minute detail which will fix this issue. Below is the desciption :

I have integrated FB login in my android app. It works fine on my device but when ran on other devices, when clicked on login, it asks for permission and when given, it goes back to Login state...It means session is not getting opened on other devices..I have also used below code to generate hash key :

try {
            PackageInfo info = getPackageManager().getPackageInfo(
                    "MY_PACKAGE_NAME", 
                    PackageManager.GET_SIGNATURES);
            for (Signature signature : info.signatures) {
                MessageDigest md = MessageDigest.getInstance("SHA");
                md.update(signature.toByteArray());
                Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
                }
        } catch (NameNotFoundException e) { 
 } catch (NoSuchAlgorithmException e) {  
}

I have also placed hash key on fb page of the app using my keystore with which I am exporting the app(final one) and using correct password to generate hash key by below method (Note i am using Windows 7):

keytool -list-alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

Ofcourse I used my releasekey and the final keystore in the above command. It asked for password and I gave correct one. So I guess, hash key generated was correct. If used -exportcert instead of -list , it shows "invalid type -exportcert" .

I have added 4 key hashes till now on fb page. Sandbox mode is off.

I have been banging my head with this issue since past 6 days.I think there is some problem with hash key causing other users not letting open a fb session from app. Kindly someone help if u had faced similar problem or possible solution/approach will also help.

Appreciate your time and valuable comments.

Thanks

4

1 回答 1

0
keytool -list-alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

我看到您正在使用您的调试密钥,尝试从 Eclipse 助手导出您的应用程序,然后创建您自己的密钥库。创建完成后,再次运行上一个命令,更改密钥名称和密钥库的路径,然后将哈希密钥放在 facebook 页面上,并将导出的 .apk 安装到其他设备中。

从“运行”选项生成的 .apk 使用您的调试密钥进行签名,而使用导出助手导出的文件使用您的个人密钥进行签名。

于 2013-06-19T08:13:39.483 回答