Options
All
  • Public
  • Public/Protected
  • All
Menu
example
{
   "timestamp":     [Date],     // <-- Javascript Date instance
   "event":         [String],   // <-- motionchange|geofence|heartbeat
   "is_moving":     [Boolean],  // <-- The motion-state when location was recorded.
   "uuid":          [String],   // <-- Universally unique identifier
   "age":           [Integer],  // <-- Age of the location in milliseconds
   "coords": {
       "latitude":  [Double],
       "longitude": [Double],
       "accuracy":  [Double],
       "speed":     [Double],
       "heading":   [Double],
       "altitude":  [Double]
       "ellipsoidal_altitude":  [Double]
   },
   "activity": {
       "type": [still|on_foot|walking|running|in_vehicle|on_bicycle],
       "confidence": [0-100%]
   },
   "battery": {
       "level": [Double],
       "is_charging": [Boolean]
   },
   "odometer": [Double/meters]
}

HTTP POST Schema

The location-data schema POSTed to your server takes the following form:

example
{
    "location": {
        "coords": {
            "latitude":   [Double],
            "longitude":  [Double],
            "accuracy":   [Double],
            "speed":      [Double],
            "heading":    [Double],
            "altitude":   [Double],
            "ellipsoidal_altitude": [Double]
        },
        "extras": {   // <-- optional meta-data
            "foo": "bar"
        },
        "activity": {
            "type": [still|on_foot|walking|running|in_vehicle|on_bicycle|unknown],
            "confidence": [0-100%]
        },
        "geofence": {  // <-- Present only if a geofence was triggered at this location
            "identifier": [String],
            "action": [String ENTER|EXIT]
        },
        "battery": {
            "level": [Double],
            "is_charging": [Boolean]
        },
        "timestamp": [ISO-8601 UTC], // eg:  "2015-05-05T04:31:54.123Z"
        "age":       [Integer],      // <-- Age of the location in milliseconds
        "uuid":      [String],       // <-- Universally unique identifier
        "event"      [String],       // <-- motionchange|geofence|heartbeat
        "is_moving": [Boolean],      // <-- The motion-state when recorded.
        "odometer": [Double/meters]
    }
 }

Hierarchy

  • Location

Index

Properties

activity

activity: MotionActivity

Device motion-activity when this location was recorded (eg: still, on_foot, in_vehicle).

age

age: number

The age of the location in milliseconds, relative to the Device system-time when the location was received. For example, if the reported age is 10000, that location was recorded 10s ago, relative to the system-time. location.timestamp + location.age = Device system-time when location was recorded.

battery

battery: Battery

Device battery level when the location was recorded.

coords

coords: Coords

latitude, longitude, speed, heading, etc.

Optional event

event: string

Event responsible for generating this location (motionchange, providerchange, geofence, heartbeat).

Optional extras

extras: Extras

Optional arbitrary meta-data attached to this location.

Optional geofence

geofence: GeofenceEvent

If this location was recorded due to a geofence transition, the corresponding geofence-event.

is_moving

is_moving: boolean

true if location was recorded while plugin is in the moving state.

Optional mock

mock: boolean

Present (and true) if the location was generated by a "Fake Location" application or simulator.

odometer

odometer: number

Optional provider

If this location was recorded due to ProviderChangeEvent, this is a reference to the location-provider state.

Optional sample

sample: boolean

true if the plugin is currently waiting for the best possible location to arrive. Samples are recorded when the plugin is transitioning between motion-states (moving vs stationary) or BackgroundGeolocation.getCurrentPosition. If you're manually posting location to your server, you should not persist these "samples".

timestamp

timestamp: string

ISO-8601 UTC timestamp provided by the native location API.

uuid

uuid: string

Universally Unique Identifier. You can use this to match locations recorded at your server with those in the logs. It can also be used to ensure if the plugin has ever posted the same location twice.

Generated using TypeDoc