Facebook error: session closed and not closed normally (phonebook / facebook connection error)
I am using the phonegap build to compile the facebook connect sample app located here The app loads fine on my phone, however when I press the login button with the facebook button it looks like it will work for a second and then I get the error { "errorMessage"}: "Facebook error: Session closed and was not closed normally"}
I have done all the steps that Dom described here
I have downloaded the hash store for both sides and signed the app to the phonegap build and it still doesn't work. Any help would be greatly appreciated. thank.
source to share
Probably a problem with your hash in my experience.
It looks like you've already read them, but see Facebook's instructions here - there are many things that can go wrong:
-
Make sure you have openssl installed (type
openssl
in command line and check for errors) -
Assuming you are 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 the "=" at the end) -
Go to https://developers.facebook.com/ , select your app, go to Settings> Android, paste it into Hash and hit Save. Changes "below
-
In Android Settings Android make sure your package name is correct.
-
Deploy the debug version to your Android phone using Cordova / PhoneGap (i.e. no -release argument)
Good luck!
source to share
The problem is phonegap-facebook-plugin\platforms\android\res\values\facebookconnect.xml
You need to manually add this to facebookconnect.xml
<resources>
<string name="fb_app_id">xxxxxxxxxx</string>
<string name="fb_app_name">namespace or display name</string>
</resources>
I spent 2 days on this and everywhere offered me to check keyhash
This is the documentation: - https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/platforms/android/README.md
source to share