Assigning App Roles

To activate the handover protocol, a Page must have only one app with the Primary Receiver role and at least one app with the Secondary Receiver role. By default, the Primary Receiver app gets control of the conversation.

To assign app roles for your Page, do the following:

  1. Ensure your app has a properly configured webhook.
  2. Go to App Settings > Messenger > Settings
  3. In the 'Webhooks' section, subscribe your app to the Page you want to use the handover protocol for.
  4. Go to Page Settings > Messenger Platform > Subscribed Apps > Role.
  5. Select a role for each app. Only one app may be assigned the Primary Receiver role.

Once a role is assigned, each Facebook app will automatically be sent an app_role webhook.

{
  "recipient":{
    "id":"<PAGE_ID>"
  },
  "timestamp":1458692752478,
  "app_roles":{
    "123456789":["primary_receiver"]
  }
}

For complete details and event properties, see the app_role Webhook Event Reference.