I'm running example code (found below) through phonegap build to produce an android apk.
https://github.com/phonegap-build/FacebookConnect/blob/master/example/Simple/index.html
When I try to log into facebook through the app on an android device (with the facebook app installed), I get this error:
Invalid android_key parameter J4INwYsuTyQ_LJc1d3WZ2HReg7M does not match any allowed android key. Configure your app key hashes at http://developers.facebook.com/apps/'app id'
I have copy-pasted this key into the key hashes section of my app's android settings but it still throws the same error when I try to log in using the app.
How can I get this app to log into facebook successfully?
OR: What is another way to enable an android app to log into facebook using phonegap?
Here are some things I have done:
In my facebook app's settings:
- Set 'Package name' to the 'widget id' found in my phonegap config.xml.
- Set 'Class name' to the Package name with '.ProjectActivity' appended to it.
- Enabled 'Single Sign on' and disabled 'Deep linking'.
- Made the app open to the public (through the 'Status & Review' section.
In my phonegap config.xml (found in the /www directory in phonegap project):
- Entered APP_ID as the ID found in my facebook app dashboard
- Entered APP_NAME as the 'Namespace' found in my facebook app settings
In my phonegap build app settings:
- Made a keystore (using this answer: https://stackoverflow.com/a/19315975/1696114) and used it to generate a release apk.