Push Diagnosis Data

Introduction

The DriveKit SDK regularly collects information on the smartphone's configuration: application permissions, sensor statuses and any user-generated events.

The push diagnosis data service is designed to share all diagnosis data collected by the DriveKit SDK installed on each of your users' mobile applications with your platform.

These insights can be used to:

  • Identify users facing configuration issues, which may improve the onboarding experience

  • Detect trip recording issues caused by user events (logout, app uninstallation, phone shutdown...)

Principle

The diagnosis data push service sends the diagnosis events right after they are transmitted by the DriveKit SDK to the DriveQuant platform. The process is described below:

  • The DriveKit SDK collects the diagnosis data, which is stored locally on the user's phone.

  • The DriveKit SDK sends the diagnosis data to the DriveQuant platform at least one a day. There is no precise time for data retrieval, as this depends on the state of the application and the smartphone.

  • If you subscribe to the push diagnosis data service, the data is transmitted to your platform as soon as it is received and stored on the DriveQuant platform.

Diagnostic push can be sent even if there are no updates to the status of the diagnostic indicators. The push is triggered by the SDK. The SDK still information once a day even if there are no changes in diagnostic indicators. An empty push indicates there is no changes. The advantage of making one push per day is that the message, even if empty, confirms that the application is still installed and active on the user's phone.

All diagnostic events are shared after an initial installation and initialization of the DriveKit SDK. The diagnosis data push is not immediate, but delayed by at least 30 minutes to give the user time to grant permissions.

Configuration

Diagnosis events data is sent as a POST request to a client URL. The URL must be provided to DriveQuant in order to set up and activate the push diagnosis data service.

An example of data in JSON format is given at the end of this section.

It is mandatory to configure an HTTP response code. If the POST request is accepted, we expect a http status code 200 (OK). Any other code will be considered as a failure, and the service will attempt to send the diagnosis events data again as defined in the Automatic retry section.

If the service returns a 200 HTTP code while the data has not been accepted by the client server, then there will be no further attempt to send the data.

Security

See Security in parent section.

Automatic retry

DriveQuant will retry to push the diagnosis data if an HTTP error was previously received. In order to avoid too many consecutive retries, the push diagnosis data replay will be performed once a day from the day after a failed attempt, until the trip deletion has been accepted. Also, the failed events will be sent every time the SDK sends an update, before sending any new event. If after 30 days the trip deletion has not been accepted, the data will be discarded.

Sample Message

The body of the request is a JSON object with a set of fields containing the user unique identifier, the user's smartphone data, and a list of the events collected by the SDK, divided into 4 categories:

  1. permissions: events related to the application’s permissions

  2. sensors: events related to the smartphone’s sensors

  3. settings: events related to the smartphone’s configuration

  4. events: events related to user's events (login/logout, app install/uninstall, smartphone on/off)

The table below lists the types of diagnosis data and their possible values.

CategoryTypePossible values

permissions

NOTIFICATION_ACCESS

GRANTED / DENIED

permissions

LOCATION_ACCESS

GRANTED / DENIED

permissions

BLUETOOTH_ACCESS

GRANTED / DENIED

permissions

ACTIVITY_ACCESS

GRANTED / DENIED

sensors

GPS_SENSOR

ENABLED / DISABLED

sensors

BLUETOOTH_SENSOR

ENABLED / DISABLED

settings

LOW_POWER_MODE

ENABLED / DISABLED

settings

PERMISSIONS_AUTO_DELETE

ENABLED / DISABLED

settings

BATTERY_OPTIMISATION

ENABLED / DISABLED

events

PHONE_STATE

TURNED_ON / TURNED_OFF

events

APP_STATE

INSTALLED / UNINSTALLED

events

LOGIN_STATE

LOGGED_IN / LOGGED_OUT

Here's a sample push diagnosis message:

{
    "userId": "john.doe@drivequant.com",
    "smartphoneData": {
        "phoneModel": "iPhone 15 Pro",
        "appBuildNumber": "1032",
        "appVersion": "5.2.1",
        "osVersion": "17.4.1",
        "osType": "iOS",
        "sdkVersion": "2.1",
        "lastUpdate": "2024-05-21T08:52:53.470+0000"
    },
    "permissions": [
        {
            "date": "2024-05-20T12:15:32.000+0000",
            "type": "NOTIFICATION_ACCESS",
            "value": "DENIED"
        },
        {
            "date": "2024-05-20T14:15:32.000+0000",
            "type": "NOTIFICATION_ACCESS",
            "value": "GRANTED"
        },
        {
            "date": "2024-05-20T12:15:24.000+0000",
            "type": "BLUETOOTH_ACCESS",
            "value": "DENIED"
        },
        {
            "date": "2024-05-20T14:15:24.000+0000",
            "type": "BLUETOOTH_ACCESS",
            "value": "GRANTED"
        },
        {
            "date": "2024-05-20T12:15:26.000+0000",
            "type": "ACTIVITY_ACCESS",
            "value": "DENIED"
        },
        {
            "date": "2024-05-20T14:15:26.000+0000",
            "type": "ACTIVITY_ACCESS",
            "value": "GRANTED"
        },
        {
            "date": "2024-05-20T12:15:22.000+0000",
            "type": "LOCATION_ACCESS",
            "value": "DENIED"
        },
        {
            "date": "2024-05-20T14:15:22.000+0000",
            "type": "LOCATION_ACCESS",
            "value": "GRANTED"
        }
    ],
    "sensors": [
        {
            "date": "2024-05-20T12:14:22.000+0000",
            "type": "GPS_SENSOR",
            "value": "DISABLED"
        },
        {
            "date": "2024-05-20T14:14:22.000+0000",
            "type": "GPS_SENSOR",
            "value": "ENABLED"
        },
        {
            "date": "2024-05-20T13:15:02.000+0000",
            "type": "BLUETOOTH_SENSOR",
            "value": "DISABLED"
        },
        {
            "date": "2024-05-20T13:15:22.000+0000",
            "type": "BLUETOOTH_SENSOR",
            "value": "ENABLED"
        }
    ],
    "settings": [
        {
            "date": "2024-05-20T11:44:00.000+0000",
            "type": "LOW_POWER_MODE",
            "value": "ENABLED"
        },
        {
            "date": "2024-05-20T12:03:27.000+0000",
            "type": "LOW_POWER_MODE",
            "value": "DISABLED"
        }
    ],
    "events": [
        {
            "date": "2024-05-15T13:25:22.000+0000",
            "type": "PHONE_STATE",
            "value": "TURNED_OFF"
        },
        {
            "date": "2024-05-15T13:28:22.000+0000",
            "type": "PHONE_STATE",
            "value": "TURNED_ON"
        },
        {
            "date": "2024-05-10T14:15:22.000+0000",
            "type": "APP_STATE",
            "value": "INSTALLED"
        },
        {
            "date": "2024-05-12T08:34:21.000+0000",
            "type": "APP_STATE",
            "value": "UNINSTALLED"
        },
        {
            "date": "2024-05-18T11:12:46.000+0000",
            "type": "APP_STATE",
            "value": "INSTALLED"
        },
        {
            "date": "2024-05-10T14:20:02.000+0000",
            "type": "LOGIN_STATE",
            "value": "LOGGED_IN"
        },
        {
            "date": "2024-05-12T08:32:11.000+0000",
            "type": "LOGIN_STATE",
            "value": "LOGGED_OUT"
        },
        {
            "date": "2024-05-18T11:15:35.000+0000",
            "type": "LOGIN_STATE",
            "value": "LOGGED_IN"
        }
    ]
}

OpenAPI specification

The OpenAPI specification can be downloaded here in OpenAPI YAML format.

Last updated