文档已更新。
中文(简体) 译文尚未完成。
英语更新时间:2019年3月11日
中文(简体) 更新时间:2018年1月12日

Getting Supported Messenger Extensions SDK Features

Features of the Messenger Extensions SDK available in the webview vary depending on what version of the Messenger bot the webview is opened in. For this reason, it is important to check that the feature you are using is available when the webview is opened.

To do this. you can call getSupportedFeatures() to get an array of features that are supported on the current client. If a feature you depend on is not available, you can use this opportunity to fail gracefully with a message telling the user to upgrade.

Supported Features

The following Messenger Extensions SDK features are available in the webview:

功能说明

payments

此客户端是否支持支付功能

sharing_broadcast

使用 beginShareFlow() 打开广播流程在此客户端上有用。

sharing_direct

使用 beginShareFlow() 分享到当前对话在此客户端上有用。

sharing_open_graph

分享开放图谱消息功能可用。

context

getContext() 在网页视图中可用。

Example Request

For a complete list of method parameters, see the getSupportedFeatures() Reference.

MessengerExtensions.getSupportedFeatures(function success(result) {
  let features = result.supported_features;
}, function error(err) {
  // error retrieving supported features
});

Example Response

getSupportedFeatures() will return an array containing the featured supported in the current webview to the success callback. For details on the returned array values, see Features below.

{
  "supported_features":[
    "payments",
    "context",
    "sharing_broadcast",
    "sharing_direct",
    "sharing_open_graph"
  ]
}