diff --git a/src/api/config.ts b/src/api/config.ts index 5a3841e..d544b17 100644 --- a/src/api/config.ts +++ b/src/api/config.ts @@ -4,6 +4,7 @@ import Http from '../http'; import Logger from '../logger'; import Session from '../session'; import Navigator from '../navigator'; +import Storage from '../storage'; import type { RadarTrackParams } from '../types'; @@ -16,12 +17,14 @@ class ConfigAPI { return; } + const id = Storage.getItem(Storage.ID) || undefined; const deviceId = params.deviceId || Device.getDeviceId(); const installId = params.installId || Device.getInstallId(); const sessionId = Session.getSessionId(); const locationAuthorization = await Navigator.getPermissionStatus(); - const data = { + const data: any = { + id, deviceId, installId, sessionId, diff --git a/src/api/track.ts b/src/api/track.ts index c653f6b..4970d6b 100644 --- a/src/api/track.ts +++ b/src/api/track.ts @@ -36,6 +36,7 @@ class TrackAPI { } // user indentification fields + const id = Storage.getItem(Storage.ID) || undefined; // `undefined` so it's removed from any fields const userId = params.userId || Storage.getItem(Storage.USER_ID); const deviceId = params.deviceId || Device.getDeviceId(); const installId = params.installId || Device.getInstallId(); @@ -84,6 +85,7 @@ class TrackAPI { userId, tripOptions, timeZone, + id, }; let response: any; @@ -99,6 +101,7 @@ class TrackAPI { method: 'GET', path: 'config', data: { + id, deviceId, installId, sessionId,