![](/img/trans.png)
[英]Why does Google authentication work locally but not on Heroku?
[英]Why does the button not work in Google Assistant?
我試圖在我的Google助手操作上添加一個按鈕,但是該代碼僅適用於第一個。 在這里,我為不起作用的按鈕添加按鈕:
'Biology': {
title: 'Biology',
text:'Press the button to visit our site for more info. Biology is an important subject for those who are willing to take it, and this website will provide you' +
'with the necessary skill for this subject.',
image: new Image({
url: 'https://www.edzuki.com/biology/Biology+Edzuki.jpg',
alt: 'Biology as a subject',
}),
button: new Button({
title:'Click for the Biology Page',
url: 'https://www.edzuki.com/biology/',
}),
並且由於某種原因,這個作品
'Art': {
title: 'Art',
text:'Press the button to visit our site for more info. Art is an important subject for those who are willing to take it, and this website will provide you' +
'with the necessary skill for this subject.',
image: new Image({
url: 'https://www.edzuki.com/art/Art.jpg',
alt: 'Art as a subject',
}),
buttons: new Button({
title: 'Click for Art',
url: `https://www.edzuki.com/art/`,
}),
display: 'WHITE',
},
用於const subjectCard(基本卡)。 助手不會拋出任何錯誤,只是沒有可見的按鈕。 為什么是這樣? 提前致謝。
在第一個示例中,您將button
用作按鈕,而在第二個示例中,您將buttons
使用帶有“ s”的buttons
。 文檔還建議您使用復數版本buttons
並且您自己的代碼應根據第二個工作示例向您展示此作品
https://developers.google.com/actions/assistant/responses#basic_card
例如
'Biology': {
title: 'Biology',
text:'Press the button to visit our site for more info. Biology is an important subject for those who are willing to take it, and this website will provide you' +
'with the necessary skill for this subject.',
image: new Image({
url: 'https://www.edzuki.com/biology/Biology+Edzuki.jpg',
alt: 'Biology as a subject',
}),
buttons: new Button({
title:'Click for the Biology Page',
url: 'https://www.edzuki.com/biology/',
}),
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.