在模拟器上测试我的应用程序时,我不断收到错误消息。
它给出:“APP NAME,现在没有响应,请稍后再试”
我在这里做错了什么?
动作.JSON
{
"accountLinking": {
"clientId": "", // SENSITIVE INFORMATION BLANK
"clientSecret": "", // SENSITIVE INFORMATION BLANK
"grantType": "AUTH_CODE",
"authenticationUrl": "", // SENSITIVE INFORMATION BLANK
"accessTokenUrl": "" // SENSITIVE INFORMATION BLANK
},
"actions": [{
"description": "",
"name": "MAIN",
"fulfillment": {
"conversationName": "PASS TEXT"
},
"intent": {
"name": "actions.intent.MAIN",
"trigger": {
"queryPatterns": [
"talk to APP NAME"
]
}
}
}],
"conversations": {
"PASS TEXT": {
"name": "PASS TEXT",
"url": "" // MY FULFILLMENT END POINT
"fulfillmentApiVersion": 2
}
}
}
这只是一个向用户返回“Sure, thing”的示例。
履行终点 PHP 文件
header('Content-Type: application/json');
$a = array (
'conversationToken' => '{"state":null,"data":{}}',
'expectUserResponse' => true,
'expectedInputs' =>
array (
0 =>
array (
'inputPrompt' =>
array (
'richInitialPrompt' =>
array (
'items' =>
array (
0 =>
array (
'simpleResponse' =>
array (
'textToSpeech' => 'Okay sure',
'displayText' => 'Okay, Sure!',
),
),
),
'suggestions' =>
array (
),
),
),
'possibleIntents' =>
array (
0 =>
array (
'intent' => 'actions.intent.TEXT',
),
),
),
),
);
echo json_encode($a);
PS:也没有任何PHP错误。访问 URL 时页面运行时没有任何错误。
我还用 OAuth PLAYGROUND 对其进行了测试,返回的结果是这样的
OAUTH 操场结果
{
"finalResponse": {
"richResponse": {
"items": [
{
"simpleResponse": {
"displayText": "Sure, thing!",
"textToSpeech": "Sure thing"
}
}
]
}
},
"expectUserResponse": 0,
"isInSandbox": 1
}