Adds a geotag.
HyperTrack.addGeotag(
JSON.stringify(
{
"test_object": {
"test_key1": "test_value1"
}
}
)
);
Name | Type | Description |
---|---|---|
geotagData | JSON String | Geotag data |
JSON String of result object: Result<Result<Location, LocationError>, JsError>
Example responses:
{
"type": "success",
"value": {
"type": "success",
"value": {
"latitude": 37.33182,
"longitude": -122.03118
}
}
}
{
"type": "failure",
"value": {
"error": "<invalid geotagData value error>"
}
}
Adds a geotag with expected location.
HyperTrack.addGeotagWithExpectedLocation(
JSON.stringify(
{
"test_object": {
"test_key1": "test_value1"
}
}
),
JSON.stringify(
{
"latitude": 37.33182,
"longitude": -122.03118
}
)
);
Name | Type | Description |
---|---|---|
geotagData | JSON String | Geotag data |
expectedLocation | JSON String | Expected location as Location object |
JSON String of result object: Result<Result<LocationWithDeviation, LocationError>, JsError>
Asks for location permission (ACCESS_FINE_LOCATION
).
Asks for background location permission (ACCESS_BACKGROUND_LOCATION
).
Asks for notifications permission (POST_NOTIFICATIONS
).
Returns the device ID.
HyperTrack.getDeviceId()
Device ID String
Starts or stops tracking.
HyperTrack.setIsTracking(true)
Sets metadata.
HyperTrack.setMetadata(
JSON.stringify(
{
"test_object": {
"test_key1": "test_value1"
}
}
)
);
Name | Type | Description |
---|---|---|
metadataObjectString | JSON String | Metadata object |
JSON String of result object:
Result<Void
>
Example responses:
{
"type": "success",
}
{
"type": "failure",
"value": {
"error": "<invalid metadataObjectString value error>"
}
}
Sets name.
HyperTrack.setName("John Doe")
export enum HyperTrackError {
/**
* The SDK was remotely blocked from running.
*/
blockedFromRunning = 'blockedFromRunning',
/**
* The publishable key is invalid.
*/
invalidPublishableKey = 'invalidPublishableKey',
/**
* The user enabled mock location app while mocking locations is prohibited.
*/
locationMocked = 'location.mocked',
/**
* The user disabled location services systemwide.
*/
locationServicesDisabled = 'location.servicesDisabled',
/**
* [Android only] The device doesn't have location services.
*/
locationServicesUnavailable = 'location.servicesUnavailable',
/**
* GPS satellites are not in view.
*/
locationSignalLost = 'location.signalLost',
/**
* [Android only] The SDK wasn't able to start tracking because of the limitations imposed by the OS.
* The exempt from background execution conditions weren't met.
* {@link https://developer.android.com/guide/components/foreground-services#background-start-restriction-exemptions}
*/
noExemptionFromBackgroundStartRestrictions = 'noExemptionFromBackgroundStartRestrictions',
/**
* The user denied location permissions.
*/
permissionsLocationDenied = 'permissions.location.denied',
/**
* Can’t start tracking in background with When In Use location permissions.
* SDK will automatically start tracking when app will return to foreground.
*/
permissionsLocationInsufficientForBackground = 'permissions.location.insufficientForBackground',
/**
* [iOS only] The user has not chosen whether the app can use location services.
*/
permissionsLocationNotDetermined = 'permissions.location.notDetermined',
/**
* [iOS only] The app is in Provisional Always authorization state, which stops sending locations when app is in background.
*/
permissionsLocationProvisional = 'permissions.location.provisional',
/**
* The user didn't grant precise location permissions or downgraded permissions to imprecise.
*/
permissionsLocationReducedAccuracy = 'permissions.location.reducedAccuracy',
/**
* [iOS only] The app is not authorized to use location services.
*/
permissionsLocationRestricted = 'permissions.location.restricted',
/**
* [Android only] The user denied notification permissions needed to display a persistent notification
* needed for foreground location tracking.
*/
permissionsNotificationsDenied = 'permissions.notifications.denied',
}
{
"error": String,
}
{
"latitude": Double,
"longitude": Double,
}
{
"latitude": Double,
"longitude": Double,
}
- Tracking is not started (adding geotags is not possible)
{
"type": "notRunning
}
- SDK is not initialized yet (no location data to add geotag)
{
"type": "starting
}
- There was an outage while getting the location data
{
"type": "hyperTrackError",
"value": HyperTrackError
}
{
"location": Location,
"deviation": Double,
}
{
"type": "success",
"value": Success,
}
{
"type": "failure",
"value": Failure,
}