MessengerExtensions.getGrantedPermissions() Reference

Messenger Extensions SDK

This method is a part of the Messenger Extensions SDK. For information on including the SDK in your site, see Add Messenger Extensions SDK.

The getGrantedPermissions() method of the Messenger Extensions SDK allows you to retrieve a list of permissions you are currently granted by the person that opened the webview.

Contents

Available Permissions

When a person begins a conversation with the bot for the first time, the following perissions are implicitly granted:

  • user_profile
  • user_messaging

There may be other situations where only one (or neither) is granted, such as encountering the bot via a plugin or ad, or encountering a page shared by a friend using a bot.

Method

MessengerExtensions.getGrantedPermissions(success, error)

Example

MessengerExtensions.getGrantedPermissions(function (permissions_response) {
  let permission = permissions_response.permissions // list of permissions granted
}, function() {
  // An error occurred
});

permission_response Object

The permission_response object is passed to the success callback.

{
  "permissions":[
    "user_profile",
    "user_messaging"
  ]
}

Properties

Property Type Description

permissions

Array<String>

A list of the permissions that are currently granted.