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