MessengerExtensions.getSupportedFeatures()

Messenger 擴充功能 SDK

此方法屬於 Messenger 擴充功能 SDK 的一部分。若要瞭解在網站中加入 SDK 的相關資訊,請參閱新增 Messenger 擴充功能 SDK

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() 可於 webview 中使用。