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.

+3


source to share


4 answers


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!

+4


source


Key problem. If you have Android Studio installed and you can see the logcat when you try to login, an error will appear. This error will have a key to be added to the facebook app.



0


source


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

0


source


Indicates that the session is closed and that it was not closed normally. This usually means that the open call failed and the Exception parameter for the StatusCallback will not be null.

-1


source







All Articles