I am using Sharekit for Facebook sharing with the Facebook Graph API. I have tried to find the latest, most up to date code (troppoli on github seems pretty up-to-date).
Using sharekit to log out of Twitter works fine with the line: [SHK logoutOfService:@”SHKTwitter”]; but the same line for Facebook, [SHK logoutOfService:@”SHKFacebook”], yields different results.
When I go to log back in, the login screen does not show. Instead, a screen with the text: “You have already authorized … Press okay to continue.” Then at the bottom of the screen, “Logged in as …” and “Log out” . But the user is supposedly already logged out.
Even worse, if I press the “Okay” button to continue on, I get the error: “The operation couldn’t be completed. (NSURLErrorDomain error -999.)
I think I may need to tweak ShareKit to make this work but I hate to do that. Has anyone else come across this?
I’m pretty sure this has something to do with the new Facebook Single-Sign-On (SSO). If the user has Facebook version 3.2.3 or greater installed, or if Safari is on the device (or simulator), authorization now takes place OUTSIDE of the app. Will post more as I find it.
EDIT: Apart from the NSURL error, it seems that this is the expected behavior with the new Facebook SSO. Users are supposed to remain in a pseudo-logged in/logged out state after ‘logging out’ of your app, in case they are logged into another app, etc. – it’s all connected now. To really log out of facebook (to say, log in as someone else, etc.) it seems that the user needs to click the logout link on the authorization webview that shows when they are “logged out” of facebook in your app. I could be wrong but I’m pretty sure about this.
Apart from the above, I did find a way to get rid of the NSURL error and this makes things a lot better, and much more palatable. See How Do I Fix NSURLErrorDomain Error -999 in iPhone.
For more on the new Facebook SSO:
Excerpt from Facebook iOS Tutorial (see especially last paragraph):
Hope this helps, let me know if you find anything different.