2017-06-26 10 views
2

webhookとgoogle v2の操作を使用して端末の場所をリクエストするにはどうすればよいですか。Googleの操作 - 場所の許可

以前は、私はpermission_requestフィールドを使用しましたが、現在は推奨されていませんが、レスポンスオブジェクトのどこに収まるかわかりません。

JSONレスポンス

{ 
speech: "", 
displayText: "", 
data: { 
google: { 
expectUserResponse: true, 
noInputPrompts: [ 
{ 
textToSpeech: "Hello McFly!" 
}, 
{ 
textToSpeech: "Good talk, Russ" 
}, 
{ 
textToSpeech: "Alright, I'm just gonna go over here and hang out. Let me know if there is anything else I can do for you." 
} 
], 
richResponse: { 
items: [ 
{ 
simpleResponse: { 
textToSpeech: "Testing", 
ssml: "<speak >Testing</speak>", 
displayText: "Testing" 
}, 
basicCard: null 
} 
], 
suggestions: [ ], 
linkOutSuggestion: { 
destinationName: null, 
url: null 
} 
}, 
systemIntent: null, 
possibleIntents: [ 
{ 
intent: "actions.intent.PERMISSION", 
inputValueData: { 
@type: "type.googleapis.com/google.actions.v2.PermissionValueSpec", 
optContext: "To provide weather information for you.", 
permissions: [ 
"DEVICE_COARSE_LOCATION" 
] 
} 
} 
] 
} 
}, 
contextOut: [ ], 
source: "Abbi" 
} 
+0

を働くユーザー情報ヘルパーを見てきましたが:https://developers.google.com/actions/assistant/helpers#calling_the_helper –

+0

私は、交流#のウェブフックを使用しています私のオブジェクトは少し違っています。私のwebhookから生成されたjsonパッケージの例は、https://gist.github.com/NicoSB/ab98b91f033b9be6e09223f597cfae40にあります。そして、どのレベルの "PossibleIntent"オブジェクトが所属しているのか分かりません。 – NiteLordz

+0

ExpectedIntentを意味する場合、これは文書化されています。前の例のjsonにhttps://developers.google.com/actions/sdk/webhook#ExpectedIntent –

答えて

3

ので、私は、システムの意図、期待できない意思、または可能な意図として許可要求を追加する必要がありました。

以下JSONは今

{ 
speech: "", 
displayText: "", 
data: { 
google: { 
expectUserResponse: true, 
noInputPrompts: [ 
{ 
textToSpeech: "Hello McFly!" 
}, 
{ 
textToSpeech: "Good talk, Russ" 
}, 
{ 
textToSpeech: "Alright, I'm just gonna go over here and hang out. Let me know if there is anything else I can do for you." 
} 
], 
richResponse: { 
items: [ 
{ 
simpleResponse: { 
textToSpeech: "", 
ssml: "<speak ></speak>", 
displayText: "" 
}, 
basicCard: null 
} 
], 
suggestions: [ ], 
linkOutSuggestion: { 
destinationName: null, 
url: null 
} 
}, 
systemIntent: { 
intent: "actions.intent.PERMISSION", 
data: { 
@type: "type.googleapis.com/google.actions.v2.PermissionValueSpec", 
optContext: "To provide an accurate experience, ", 
permissions: [ 
"DEVICE_PRECISE_LOCATION" 
], 
carouselSelect: null 
} 
} 
} 
}, 
contextOut: [ ], 
source: "Abbi" 
} 
関連する問題