public class Permission implements HelperIntent
Helper intent response to request user for permissions. Usage:
ResponseBuilder responseBuilder = getResponseBuilder();
responseBuilder
.add("Placeholder for permissions text")
.add(new Permission()
.setPermissions(new String[]{
ConstantsKt.PERMISSION_NAME,
ConstantsKt.PERMISSION_DEVICE_PRECISE_LOCATION)
.setContext("To provide a better experience"));
To get the user's response:
boolean permissionGranted = request.isPermissionGranted() != null &&
request.isPermissionGranted().booleanValue();
Constructor and Description |
---|
Permission()
Helper intent response to request user for permissions.
Usage:
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
java.util.Map<java.lang.String,java.lang.Object> |
getParameters() |
void |
prepareMap() |
Permission |
setContext(java.lang.String context) |
Permission |
setPermissions(java.lang.String[] permissions) |
Permission |
setUpdatePermissionValueSpec(com.google.api.services.actions_fulfillment.v2.model.UpdatePermissionValueSpec updatePermissionValueSpec) |
getName, getParameters
public Permission()
Helper intent response to request user for permissions. Usage:
ResponseBuilder responseBuilder = getResponseBuilder();
responseBuilder
.add("Placeholder for permissions text")
.add(new Permission()
.setPermissions(new String[]{
ConstantsKt.PERMISSION_NAME,
ConstantsKt.PERMISSION_DEVICE_PRECISE_LOCATION)
.setContext("To provide a better experience"));
To get the user's response:
boolean permissionGranted = request.isPermissionGranted() != null &&
request.isPermissionGranted().booleanValue();
public Permission setPermissions(java.lang.String[] permissions)
public Permission setContext(java.lang.String context)
public Permission setUpdatePermissionValueSpec(com.google.api.services.actions_fulfillment.v2.model.UpdatePermissionValueSpec updatePermissionValueSpec)
public java.lang.String getName()
public void prepareMap()
public java.util.Map<java.lang.String,java.lang.Object> getParameters()