Permission options
Additional configuration data required by a built-in intent. Possible
values for the built-in intents: actions.intent.OPTION ->
[google.actions.v2.OptionValueSpec], actions.intent.CONFIRMATION ->
[google.actions.v2.ConfirmationValueSpec],
actions.intent.TRANSACTION_REQUIREMENTS_CHECK ->
[google.actions.v2.TransactionRequirementsCheckSpec],
actions.intent.DELIVERY_ADDRESS ->
[google.actions.v2.DeliveryAddressValueSpec],
actions.intent.TRANSACTION_DECISION ->
[google.actions.v2.TransactionDecisionValueSpec],
actions.intent.PLACE ->
[google.actions.v2.PlaceValueSpec],
actions.intent.Link ->
[google.actions.v2.LinkValueSpec]
The built-in intent name, e.g. actions.intent.TEXT
, or intents
defined in the action package. If the intent specified is not a built-in
intent, it is only used for speech biasing and the input provided by the
Google Assistant will be the actions.intent.TEXT
intent.
Optionally, a parameter of the intent that is being requested. Only valid for requested intents. Used for speech biasing.
Generated using TypeDoc
Asks the Assistant to guide the user to grant a permission. For example, if you want your app to get access to the user's name, you would invoke
conv.ask(new Permission)
with the context containing the reason for the request, and the GoogleActionsV2PermissionValueSpecPermissions permission. With this, the Assistant will ask the user, in your agent's voice, the following: '[Context with reason for the request], I'll just need to get your name from Google, is that OK?'.Once the user accepts or denies the request, the Assistant will fire another intent:
actions.intent.PERMISSION
with a boolean argument:PERMISSION
and, if granted, the information that you requested.Notes for multiple permissions:
conv.ask(new Permission)
.DEVICE_COARSE_LOCATION
andDEVICE_PRECISE_LOCATION
at once is equivalent to just asking forDEVICE_PRECISE_LOCATION
// Actions SDK const app = actionssdk() app.intent('actions.intent.MAIN', conv => { conv.ask(new Permission({ context: 'To read your mind', permissions: 'NAME', })) }) app.intent('actions.intent.PERMISSION', (conv, input, granted) => { // granted: inferred first (and only) argument value, boolean true if granted, false if not const explicit = conv.arguments.get('PERMISSION') // also retrievable w/ explicit arguments.get const name = conv.user.name }) // Dialogflow const app = dialogflow() app.intent('Default Welcome Intent', conv => { conv.ask(new Permission({ context: 'To read your mind', permissions: 'NAME', })) }) // Create a Dialogflow intent with the `actions_intent_PERMISSION` event app.intent('Get Permission', (conv, params, granted) => { // granted: inferred first (and only) argument value, boolean true if granted, false if not const explicit = conv.arguments.get('PERMISSION') // also retrievable w/ explicit arguments.get const name = conv.user.name })
Read more:
conv.arguments.get('PERMISSION')
Once the user accepts or denies the request, the Assistant will fire another intent:
actions.intent.PERMISSION
with a boolean argument:PERMISSION
and, if granted, the information that you requested.Notes for multiple permissions:
conv.ask(new Permission)
.DEVICE_COARSE_LOCATION
andDEVICE_PRECISE_LOCATION
at once is equivalent to just asking forDEVICE_PRECISE_LOCATION
// Actions SDK const app = actionssdk() app.intent('actions.intent.MAIN', conv => { conv.ask(new Permission({ context: 'To read your mind', permissions: 'NAME', })) }) app.intent('actions.intent.PERMISSION', (conv, input, granted) => { // granted: inferred first (and only) argument value, boolean true if granted, false if not const explicit = conv.arguments.get('PERMISSION') // also retrievable w/ explicit arguments.get const name = conv.user.name }) // Dialogflow const app = dialogflow() app.intent('Default Welcome Intent', conv => { conv.ask(new Permission({ context: 'To read your mind', permissions: 'NAME', })) }) // Create a Dialogflow intent with the `actions_intent_PERMISSION` event app.intent('Get Permission', (conv, params, granted) => { // granted: inferred first (and only) argument value, boolean true if granted, false if not const explicit = conv.arguments.get('PERMISSION') // also retrievable w/ explicit arguments.get const name = conv.user.name })
Read more:
conv.arguments.get('PERMISSION')
// Actions SDK const app = actionssdk() app.intent('actions.intent.MAIN', conv => { conv.ask(new Permission({ context: 'To read your mind', permissions: 'NAME', })) }) app.intent('actions.intent.PERMISSION', (conv, input, granted) => { // granted: inferred first (and only) argument value, boolean true if granted, false if not const explicit = conv.arguments.get('PERMISSION') // also retrievable w/ explicit arguments.get const name = conv.user.name }) // Dialogflow const app = dialogflow() app.intent('Default Welcome Intent', conv => { conv.ask(new Permission({ context: 'To read your mind', permissions: 'NAME', })) }) // Create a Dialogflow intent with the `actions_intent_PERMISSION` event app.intent('Get Permission', (conv, params, granted) => { // granted: inferred first (and only) argument value, boolean true if granted, false if not const explicit = conv.arguments.get('PERMISSION') // also retrievable w/ explicit arguments.get const name = conv.user.name })
Read more:
conv.arguments.get('PERMISSION')