NodeJS 中的 Messenger Bot - 开始按钮没有颜色
Messenger Bot in NodeJS - Get Started Button Has No Color
我在 app.listen()
方法中使用 createGetStarted()
,它出现并且操作正常,但按钮只是白色按钮顶部的蓝色悬停文本,没有边框。基本上 只是一个文本 link,而不是一个按钮 。可能是什么问题?
我有这个方法来调用合适的 API:
function callThreadSettingsAPI(data) { //Thread Reference API
request({
uri: 'https://graph.facebook.com/v2.6/me/thread_settings',
qs: { access_token: PAGE_ACCESS_TOKEN },
method: 'POST',
json: data
}, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log("Thread Settings successfully changed!");
} else {
console.error("Failed calling Thread Reference API", response.statusCode, response.statusMessage, body.error);
}
});
}
此方法创建 json:
function createGetStarted() {
var data = {
setting_type: "call_to_actions",
thread_state: "new_thread",
call_to_actions:[
{
payload:"getStarted"
}
]
};
callThreadSettingsAPI(data);
}
没错。按钮的外观会因用于访问 Facebook 的设备和软件而异,例如 Chrome 在计算机上或 Messenger 应用程序在 iPhone.
Chrome 在 Windows:
iPhone 上的 Messenger 应用:
我在 app.listen()
方法中使用 createGetStarted()
,它出现并且操作正常,但按钮只是白色按钮顶部的蓝色悬停文本,没有边框。基本上 只是一个文本 link,而不是一个按钮 。可能是什么问题?
我有这个方法来调用合适的 API:
function callThreadSettingsAPI(data) { //Thread Reference API
request({
uri: 'https://graph.facebook.com/v2.6/me/thread_settings',
qs: { access_token: PAGE_ACCESS_TOKEN },
method: 'POST',
json: data
}, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log("Thread Settings successfully changed!");
} else {
console.error("Failed calling Thread Reference API", response.statusCode, response.statusMessage, body.error);
}
});
}
此方法创建 json:
function createGetStarted() {
var data = {
setting_type: "call_to_actions",
thread_state: "new_thread",
call_to_actions:[
{
payload:"getStarted"
}
]
};
callThreadSettingsAPI(data);
}
没错。按钮的外观会因用于访问 Facebook 的设备和软件而异,例如 Chrome 在计算机上或 Messenger 应用程序在 iPhone.
Chrome 在 Windows:
iPhone 上的 Messenger 应用: