2017-06-26 5 views
2

Wie beantragen Sie den Standort des Geräts mithilfe von Webhook und Aktionen auf Google v2?Aktionen auf Google - Standortgenehmigung

Zuvor habe ich das Feld "permission_request" verwendet, aber das ist jetzt veraltet und nicht sicher, wo es in das Antwortobjekt passt.

json Antwort

{ 
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

Haben Sie an der Benutzerinformationen Helfer sah: https://developers.google.com/actions/assistant/helpers#calling_the_helper –

+0

I aC# Webhook verwende, so Mein Objekt ist anders. Beispiel für das JSON-Paket, das von meinem Webhook generiert wird, finden Sie https://gist.github.com/NicoSB/ab98b91f033b9be6e09223f597cfae40 Und ich habe Probleme herauszufinden, auf welcher Ebene "PossibleIntent" Objekt gehört. – NiteLordz

+0

Wenn Sie ExpectedIntent meinen, dann ist dies dokumentiert: https://developers.google.com/actions/sdk/webhook#ExpectedIntent –

Antwort

3

so brauchte ich die Erlaubnis-Anfrage als System Absicht, nicht zu erwarten Vorsatz oder mögliche Absicht hinzuzufügen.

die unter json arbeitet jetzt

{ 
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" 
} 
Verwandte Themen