Reputation: 11776
I'm working on an app for iOS5 and iOS6 which makes use of Facebook sdk "3.2.1". is there a way to log the user out and clear the token so that when the login button is pressed again, the user will be forced to enter his username and password again?
I use [FBSession.activeSession closeAndClearTokenInformation];
which doesn't seem to be clearing the token information as when the login button is pressed after it, safari will show
"you have already authorized 'your app'. press "Okay" to continue"
which is not the behavior I need.
Upvotes: 1
Views: 3030
Reputation: 3211
What you're seeing is not the SDK 'not clearing the token information' - the SDK has indeed cleared the token. The information that allows you to see the 'you have already authorized...' message lies with Facebook. In the user's app settings, they have an authorization setting from your app, which you asked for when they first logged in.
In order to revoke permissions from your app, you will need to touch the Graph API. FB docs, in the 'Delete' section of https://developers.facebook.com/docs/reference/api/user/
You can de-authorize an application or revoke a specific extended permissions on behalf of a user by issuing an HTTP DELETE request to PROFILE_ID/permissions with a user access_token for that app.
I'm assuming you know how to post Graph API requests using the SDK, let me know if not.
Upvotes: 5