這份文件已更新。
中文(台灣) 的翻譯尚未完成。
英文更新時間:6月26日
中文(台灣) 更新時間:2023年12月9日

Messenger Extensions JS SDK Reference

The Messenger Extensions SDK gives you the ability to tightly integrate experiences in the webview with the Messenger experience by making added functionality accessible in the webview.

Including the SDK

To make the Messenger Extensions SDK available in the webview, you must whitelist the domains for all sites that will use the SDK, and include the SDK in your site with the following script:

(function(d, s, id){
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "https://connect.facebook.net/en_US/messenger.Extensions.js";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'Messenger'));

For complete details, see Add Messenger Extensions SDK.