startLocationTracking
Starts the location tracking of a device
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"actions" | Array | Actions which are executed when a new position is set. | null |
"addressFormDataKey" | String | The key under which the address should be stored. | null |
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"background" | Boolean,String | Specifies whether tracking should work in the background. | null |
"disabledMessage" | String | Message which is displayed if the user location is deactivated. | null |
"failedMessage" | String | Message which is displayed in case of an error. | null |
"fireMultipleEvents" | Boolean,String | Specifies whether the position and address events should be fired multiple times. | null |
"latitudeFormDataKey" | String | The key under which the latitude should be stored. | null |
"loadingMessage" | String | The message which is displayed during positioning. | null |
"longitudeFormDataKey" | String | The key under which the longitude should be stored. | null |
"onAddress" | String | Event which is fired when the address is determined. | null |
"onError" | String | Event which is fired in case of an error. | null |
"onErrorType" | String | The type of onError event. | null |
"onPosition" | String | Event which is fired when the user location is determined. | null |
"onSuccess" | String | Event which will be fired in case of success. | null |
"onSuccessType" | String | The type of onSuccess event. | null |
Inherited
From Base Action
Base Action
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"dynamicParams" | Object | Dynamic params to retrieve data from a specific context e.g. a userSetting. | null |
"leadingDelimiter" | String | The leading mustache delimiter to use. | null |
"params" | Object,Array | Object containing the properties of the action. | null |
"trailingDelimiter" | String | The trailing mustache delimiter to use. | null |
"type" | String | Type name of the action. | null |
Examples
Example 1: Share a device's location.
Goal: Share a device's location, including latitude, longitude, and address.
To achieve this the following code can be used:
{
"type": "startLocationTracking",
"params": {
"addressFormDataKey": "o",
"latitudeFormDataKey": "lat",
"longitudeFormDataKey": "lon",
"deniedMessage": "Please activate the location services for this app in the settings of your device",
"disabledMessage": "Please activate the location services for this app in the settings of your device",
"failedMessage": "Your location cannot currently be determined",
"loadingMessage": "Your location is being determined...",
"onError": "",
"onSuccess": ""
}
}
Result:
The device's location will be shared.