stueynet
stueynet

Reputation: 1102

Deleting an app from a user account

Here is an interesting quandary. My website lets users register by connecting with Facebook. When the user connects we create an account for them, send them a welcome email etc... We also have a function for them to completely delete their account and all their content. However when they do this, it does not delete the app from Facebook.

When a user visits the site, it checks to see if they have connected and have granted permissions, if so it automatically either logs them in, or if it doesn't fine a user account for them, creates one. The delete action on my site deletes everything but if the user doesn't delete the app from their Facebook account, they will come back and just be given a new account on our site.

Is there a way to remove the app from the user's facebook account via an API call so that when they delete their account on my site, I can also remove the app?

Upvotes: 1

Views: 78

Answers (1)

Igy
Igy

Reputation: 43816

Yep, this is fairly simple in the API.

Using your App access token or that user's access token, make a HTTP DELETE request to https://graph.facebook.com/{USER ID}/permissions

This will uninstall the app from that user's profile. It won't prevent them re-adding it though, in which case you'll be in the same situation of needing to create a new account for the user when they return.

Upvotes: 2

Related Questions