WEB-2394 family locator sdk bridge methods - #247
Conversation
|
|
||
| ### getLocatorSdkVersion | ||
|
|
||
| <kbd>App version >= TBD</kbd> |
There was a problem hiding this comment.
Pending to define min app version
| // https://telefonicacorp.sharepoint.com/:w:/r/sites/Colabora_TCX/_layouts/15/Doc.aspx?sourcedoc=%7BD524FA49-9937-4D20-958A-7055D67B65DB%7D&file=Shared%20Spec%20%25u2013%20OBVIVO-3177%20-%20Family%20locator.docx&nav=eyJjIjoxMjA3NDU5NjUzfQ&action=default&mobileredirect=true | ||
|
|
||
| export type LocatorSdkMode = 'default' | 'observed' | 'sos'; | ||
| export type LocatorSdkConfig = Record<string, unknown>; |
There was a problem hiding this comment.
Is this lose type enough or can we define a more strict type here?
There was a problem hiding this comment.
I don't think it will change very often, but I don't see if there's any benefit of having a strict type here
There was a problem hiding this comment.
Will this type work?
The information to be sent is really complex:
{
"id": "a5a70879-fxxxx",
"requestId": "req_config_01",
"timestamp": 1764612254353,
"data": {
"license": "xxxxx",
"sdkVersion": "2.0.1",
"osPlatform": "android",
"api": {
"token": "eyJhbGciOiJIUzI1.....",
"certUrl": "https://../cert",
"tokenUrl": "https://.../token",
"scopesUrl": "https://.../scopes",
"configUrl": "https://.../config",
"groupsUrl": "https://.../groups",
"featuresUrl": "https://.../features",
"geofencesUrl": "https://.../geofences"
},
"mqtt": {
"clientId": "xxx",
"broker": "databroker.com",
"port": "8883",
"username": "xxxx"
},
"process": {
"offlineRetentionDays": 30,
"retryPolicy": {
"maxRetries": 10,
[...]
There was a problem hiding this comment.
The doc defines these types, so we can use the same definition, these is what will go inside "data"
export interface LocatorConfig {
license: string;
sdkVersion: string;
osPlatform: string;
api: LocatorApiConfig;
mqtt: LocatorMqttConfig;
process: LocatorProcessConfig;
battery?: LocatorBatteryConfig;
motion?: LocatorMotionConfig;
collect?: LocatorCollectConfig;
audioRecord?: LocatorAudioRecord;
revision?: number;
createdAt?: number;
updatedAt?: number;
}
export interface LocatorApiConfig {
token: string;
certUrl?: string;
scopesUrl?: string;
tokenUrl?: string;
configUrl?: string;
groupsUrl?: string;
featuresUrl?: string;
geofencesUrl?: string;
}
export interface LocatorMqttConfig {
clientId?: string;
broker?: string;
port?: string;
username?: string;
}
export interface LocatorRetryPolicy {
maxRetries?: number;
baseDelayMs?: number;
backoffFactor?: number;
}
export interface LocatorProcessConfig {
retryPolicy?: LocatorRetryPolicy;
offlineRetentionDays?: number;
foregroundServiceNotification?: {
title?: string;
message?: string;
};
}
export interface LocatorBatteryEvent {
name: string;
min: number;
max: number;
interval: number;
charging: boolean;
powerMode: LocatorPowerMode[];
}
export enum LocatorPowerMode {
NORMAL = "normal",
POWER_SAVER = "power_saver",
SUPER_SAVER = "super_saver",
}
export interface LocatorBatteryConfig {
events?: LocatorBatteryEvent[];
}
export interface LocatorMotionConfig {
sensitivity?: number;
}
export interface LocatorCollectConfig {
collectIntervalMillis?: number;
sendIntervalMillis?: number;
minDisplacementMeters?: number;
maxTravelDistanceMeters?: number;
highAccuracy?: boolean;
maxBatchSize?: number;
}
export interface LocatorAudioRecord {
recordsCount: number;
durationSeconds: number;
retryCount: number;
intervalSeconds: number;
audioServiceNotification?: {
title?: string;
message?: string;
};
}
closes #246