问题
When i used the simple facebook login for Android which i made a few days ago i didn't have this prolbem.
Now when i run the app i get an "invalid key" - "Android key mismatch"
06-07 02:08:51.104: W/GET_MESSAGE(273): invalid_key:Android key mismatch. Your key "Es2Fbgrno9htovlX6FcXiex6u0I" does not match the allowed keys specified in your application settings. Check your application settings at http://www.facebook.com/developers
![api-key] http://imgur.com/8uTnu
And here is the wrong key i get from the Android app :
![wrong-key] http://imgur.com/TCD5k
The key that i get from the app as an error is different from the key i have declared in Facebook developers
回答1:
The key that is displayed in your error logs is the app signature sent by facebook. All you need to do is copy this key and paste it in your app dashboard,android app key_hash section.
回答2:
Make sure to set the key on the developers site (Native Android App Key Hash) to the hash of your signing cert. This is different than the API key.
See the instructions here, Step 4: Add app signature to the Facebook App https://developers.facebook.com/docs/mobile/android/sso/
Es2Fbgrno9htovlX6FcXiex6u0I is your hash - set the "Android Key Hash" to this value on the site.
回答3:
Generate a SHA1, this link can help you. Generating SHA1
来源:https://stackoverflow.com/questions/10923735/android-facebook-invalid-key-android-key-mismatch