在Google Assistant应用中拨打电话时出现问题 [英] Issue in make a phone call within Google Assistant App
问题描述
我尝试在基本卡中实现按钮
I try to implement button in basic card i got an error
API版本2:无法使用'INVALID_ARGUMENT解析JSON响应字符串'错误:(expected_inputs [0] .input_prompt.rich_initial_prompt.items [1] .basic_card.buttons [0] .open_url_action)版本:找不到字段。 HTTP状态码:200。
API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: "(expected_inputs[0].input_prompt.rich_initial_prompt.items[1].basic_card.buttons[0].open_url_action) versions: Cannot find field." HTTP Status Code: 200.
conv.ask(new BasicCard({
text: `This is a basic card. Text in a basic card can include "quotes" and`,
subtitle: 'This is a subtitle',
buttons: [
{
"title": "Call",
"openUrlAction": {
"url": "tel:+91123456789",
"androidApp": {
"packageName": "com.android.phone"
},
"versions": []
}
},
],
"formattedText": "Some text",
image: new Image({
url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png',
alt: 'Image alternate text',
}),
"title": "Card Title"
}));
,我尝试了所有方法在按钮数组中添加另一个空对象,同样的错误:
and I tried all the ways add another empty object in button array also same error:
buttons: [
{
"title": "Call",
"openUrlAction": {
"url": "tel:+91123456789",
"androidApp": {
"packageName": "com.android.phone"
},
"versions": []
}
},
{}
],
以下尝试的代码出错:
expected_inputs [0] .input_prompt.rich_initial_prompt .items [1] .basic_card.buttons [0] .open_url_action:协议必须为http或https。
expected_inputs[0].input_prompt.rich_initial_prompt.items[1].basic_card.buttons[0].open_url_action: the protocol must be http or https.
buttons: new Button({
"title": "button text",
'url': "tel:+91123456789",
"androidApp": {
"packageName": "com.android.phone"
}
})
在操作控制台Sim中获得响应运算符:
got response in action console simulator:
"buttons": [
{
"title": "button text",
"openUrlAction": {
"url": "tel:+919177723773"
}
}
]
推荐答案
您使用的URL属性包括电话号码。链接属性只能使用指向网页的链接。这还会在您得到的错误消息中返回:
The URL property that you are using includes a phonenumber. The link property can only use links to a webpage. This also comes back in the error message that you are getting:
协议必须为http或https。。
因此,如果要解决此错误,则需要在按钮中包含http或https链接,而不要包含电话号码。
So if you want to fix the error, you need to include a http or https link in your button instead of a phonenumber.
关于通过Google Assistant应用拨打电话号码,目前不确定是否支持此功能。
As for calling a phonenumber from the Google Assistant App, I'm not sure if this feature is supported at the moment.
这篇关于在Google Assistant应用中拨打电话时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!