1

I would like to handle the case when a user removes my app manually from business integrations.

I want to know 2 things:

1- What webhook should I use?

2- Does this webhook return the account id of the user?

I have investigated ad_account webhook in Application object but I'm not sure from the documentation if that is the webhook I need. I also don't know what the fields in the payload represent.

Thanks

Ielgohary
  • 103
  • 2
  • 9

1 Answers1

1

There are multiple ways to achieve this.

Method 1: You can enable a deauthorize callback through the App Dashboard. Just go to your app, then choose the Products, then Facebook Login, and finally Settings. https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow#deauth-callback

Method 2: By configuring a Permissions Webhook to your app:

  1. Add the "Webhooks" product to your app
  2. Select "Permissions" from the list
  3. Configure the Callback URL, Verify Token & enable the "Include values" switch
  4. Subscribe to the "connected" field: https://developers.facebook.com/docs/graph-api/webhooks/reference/permissions/#connected

You will now receive the following object when a user installs/removes your app:

"object": "permissions", "entry": [{"id": "10000123456789", "uid": "10000123456789", "time": 1576834276, "changes": [{"verb": "revoked", "field": "connected"}]}]}

Where "uid" is the account id of the user (app scoped user ID).

Additionally, you can also subscribe to individual permissions a user accepts/removes in your app, such as email address:

{"object": "permissions", "entry": [{"id": "10000123456789", "uid": "10000123456789", "time": 1576836231, "changes": [{"value": {"verb": "revoked"}, "field": "email"}]}]}
Veur
  • 35
  • 1
  • 6