5

I made an android app which uses Cordova-Facebook plugin inorder to connect to Facebook and use the Facebook API's .. while trying it on the mobile i am able to login to Facebook and the api works but the second time i do so i get an error saying

cordova Facebook connect plugin fail on login ! Facebook error: failed to receive access token

( sandbox : disabled )

tried this : Cordova facebook connect plugin fail on login in android

but doesn't work

what am i doing wrong ?

Community
  • 1
  • 1
Dhayalan Pro
  • 579
  • 1
  • 5
  • 20
  • If you can log in once, so the problem isnt the sandbox. Natively (java) when you open a facebook Session and try to open it again you will get this error. So, you call the Session.getActiveSession() and check if is already opened. What we have to do is find if the problem is in your code or some bug in plugin. For that you need to show some code, then I can try to help you. – Scoup Mar 26 '14 at 02:44
  • Have you generated the hash nad mentioned the same in the App settings? If yes, what version of OpenSSL have you used? – Sahil Mittal Mar 27 '14 at 18:43
  • @SahilMittal Yeah done that ... i read about the problem with some version ., no prob with the Hash :/ – Dhayalan Pro Mar 28 '14 at 09:59

1 Answers1

1

On native android, you can get this error when you try to getAccessToken without getActiveSession when user already logged (a session was created and you try to retrive it again). You can just add the session.getActiveSession() on onResume and will work. You can see here.

But I really don't know if the problem is with the plugin you are using (I never used), or in your code. You need to share more than that.

Community
  • 1
  • 1
Scoup
  • 1,323
  • 8
  • 11