MessengerExtensions.getSupportedFeatures()

Messenger 功能插件 SDK

这是 Messenger 功能插件 SDK 提供的一种方法。如需详细了解如何在网站上添加 SDK,请参阅添加 Messenger 功能插件 SDK

Contents

Method

MessengerExtensions.getSupportedFeatures(success, error)

Example

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

Parameters

Parameter Type Description

success

Function

Success callback function. Receives an array of features supported in the current webview.

error

Function

Error callback function. Called if Messenger was unable to retrieve supported features.

Returns

An object with the supported features is returned to the success callback.

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

Properties

Property Type Description

supported_features

Array<String>

A list of features supported in the current webview. For details, see Features

Features

The following values may be returned in the supported_features array:

功能说明

payments

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

sharing_broadcast

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

sharing_direct

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

sharing_open_graph

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

context

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