Reputation: 43
I'm using phonegap build to compile the example facebook connect app located here The app loads fine on my phone, however, when I click the login with facebook button, it looks like it will work for a second and then I get the error {"errorMessage"}:"Facebook error: Session was closed and was not closed normally"}
I have done all the steps Dom has outlined here
I have uploaded a keystore hash to both facebook and signed the app on phonegap build and its still not working. Any help would be appreciated. thanks.
Upvotes: 3
Views: 1939
Reputation: 3763
Problem is with phonegap-facebook-plugin\platforms\android\res\values\facebookconnect.xml
You need to manually add this in facebookconnect.xml
<resources>
<string name="fb_app_id">xxxxxxxxxx</string>
<string name="fb_app_name">namespace or display name</string>
</resources>
I wasted 2 days for this and everywhere was suggesting me to check keyhash
This is documentation :- https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/platforms/android/README.md
Upvotes: 0
Reputation: 116
Problem is with key has. If you have Android Studio installed and you can see logcat when you try to login there will be an error. In that error will be a key has which must be added in facebook app.
Upvotes: 0
Reputation: 18932
Probably an issue with your hash in my experience.
Looks like you've already read them, but see the Facebook instructions here - there are lots of things that can go wrong:
Make sure you have openssl installed (type openssl
at the command line and see if it errors)
Assuming you're on Windows, run this command, ensuring you replace YOURUSER correctly: keytool -exportcert -alias androiddebugkey -keystore "c:\users\YOURUSER\.android\debug.keystore" | openssl sha1 -binary | openssl base64
, and copy the printed hash (including '=' at end)
Go to https://developers.facebook.com/, select your app, go to Settings > Android, paste into Key Hashes, then click 'Save Changes' at the bottom
While in your Facebook Android settings, check that your package name is correct
Deploy a debug version to your Android phone using Cordova/PhoneGap (i.e. no --release argument)
Good luck!
Upvotes: 4
Reputation: 1044
Indicates that the Session is closed, and that it was not closed normally. Typically this means that the open call failed, and the Exception parameter to StatusCallback will be non-null.
Upvotes: -1