Android Facebook SDK SSO “the page you requested c

2020-07-13 11:07发布

问题:

I've been stuck on this very frustrating problem all day and through Google I've found many people with the same problem with no answers that relate to the new Facebook API for Android. I have followed the steps listed here exactly :

https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

When I run the sample app on my device I get this:

When I run it on the emulator it works. I understand this to be because of Facebook's SSO implementation. The emulator does not have facebook installed so it signs in for the first time successfully, but the device launches the facebook app and for some reason gives this error and when I travel back, it is as if I am not logged into facebook at all and there is no active session (though I am because when it launches the facebook app I can browse friends, etc.)

I cannot uninstall facebook on my device and even if I could that would be unacceptable for the app users. If possible, I'd like to retain the SSO feature, but somehow make it work!

I have spent all day going back and forth with my Hash Keys, and generated them through my device+code and with the keytool and they match so the problem is not related to that. Besides, the sample app runs on the emulator which surely means its an SSO problem. Thanks in advance.

回答1:

After 8 hours of scanning through my code and the facebook docs, I simply decided to update my facebook app on my tablet ( I never use it and so never bothered to update it ) and now it all works.

I guess the Facebook app on my tablet was pre-SSO of Facebook on Android, but my created app was expecting it to be supported and giving the error.



回答2:

Just to be a bit more clear, if you are either running on your device or on the simulator, make sure you have the latest Facebook APK installed. Facebook changed their permissions a while ago, and you may have to manually go to the Google Play store in order to download the updated version of Facebook (it may not auto-update for you given the permission changes).



回答3:

Disabling Facebook did the trick for me. It forces the app to launch the browser and surf to Facebook that way