react-native-my-survey-sdk 2.2.33 → 2.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
XeboUserData,
|
|
9
9
|
XeboQualityFlags,
|
|
10
10
|
XeboGeolocation,
|
|
11
|
+
XeboDeviceInfo,
|
|
11
12
|
} from '../models/XeboModels';
|
|
12
13
|
import {
|
|
13
14
|
APICollectorResponse,
|
|
@@ -379,6 +380,7 @@ export interface SubmitMeta {
|
|
|
379
380
|
endTime?: string;
|
|
380
381
|
qualityFlags?: XeboQualityFlags;
|
|
381
382
|
geolocation?: XeboGeolocation;
|
|
383
|
+
deviceInfo?: XeboDeviceInfo;
|
|
382
384
|
}
|
|
383
385
|
|
|
384
386
|
export async function submitResponse(
|
|
@@ -412,13 +414,17 @@ export async function submitResponse(
|
|
|
412
414
|
|
|
413
415
|
const payload: Record<string, unknown> = {
|
|
414
416
|
collector_id: collectorUUID,
|
|
415
|
-
...(meta?.qualityFlags && { qualityFlags: meta.qualityFlags }),
|
|
416
|
-
...(meta?.geolocation && { geoLocation: meta.geolocation }),
|
|
417
417
|
responses: [
|
|
418
418
|
{
|
|
419
419
|
response_status: 'complete',
|
|
420
|
+
mode: 'React Native SDK',
|
|
421
|
+
...(meta?.startTime && { start_time: meta.startTime }),
|
|
422
|
+
...(meta?.endTime && { end_time: meta.endTime }),
|
|
420
423
|
...(timeTakenSecs !== undefined && { time_spent: timeTakenSecs }),
|
|
421
424
|
...(Object.keys(customVariables).length > 0 && { custom_variables: customVariables }),
|
|
425
|
+
...(meta?.qualityFlags && { qualityFlags: meta.qualityFlags }),
|
|
426
|
+
...(meta?.deviceInfo && { deviceInfo: meta.deviceInfo }),
|
|
427
|
+
...(meta?.geolocation && { geoLocation: meta.geolocation }),
|
|
422
428
|
questions: filteredAnswers.map(a => ({
|
|
423
429
|
uuid: a.questionId,
|
|
424
430
|
answer: a.value.map(v => ({
|
|
@@ -311,6 +311,11 @@ class XeboSurveyManagerClass extends SimpleEventEmitter {
|
|
|
311
311
|
endTime,
|
|
312
312
|
qualityFlags: this._buildQualityFlags(),
|
|
313
313
|
geolocation: this._buildGeolocation(),
|
|
314
|
+
deviceInfo: {
|
|
315
|
+
type: this.deviceModel,
|
|
316
|
+
os: this.osVersion,
|
|
317
|
+
browser: 'React Native SDK',
|
|
318
|
+
},
|
|
314
319
|
},
|
|
315
320
|
);
|
|
316
321
|
|
|
@@ -347,6 +352,11 @@ class XeboSurveyManagerClass extends SimpleEventEmitter {
|
|
|
347
352
|
osVersion: this.osVersion,
|
|
348
353
|
qualityFlags: this._buildQualityFlags(),
|
|
349
354
|
geolocation: this._buildGeolocation(),
|
|
355
|
+
deviceInfo: {
|
|
356
|
+
type: this.deviceModel,
|
|
357
|
+
os: this.osVersion,
|
|
358
|
+
browser: 'React Native SDK',
|
|
359
|
+
},
|
|
350
360
|
};
|
|
351
361
|
|
|
352
362
|
await XeboOfflineQueue.enqueue(queued);
|
|
@@ -380,6 +390,7 @@ class XeboSurveyManagerClass extends SimpleEventEmitter {
|
|
|
380
390
|
endTime: queued.endTime,
|
|
381
391
|
qualityFlags: queued.qualityFlags,
|
|
382
392
|
geolocation: queued.geolocation,
|
|
393
|
+
deviceInfo: queued.deviceInfo,
|
|
383
394
|
},
|
|
384
395
|
);
|
|
385
396
|
if (!result.ok) throw new Error(`HTTP ${result.status}`);
|
package/src/models/XeboModels.ts
CHANGED
|
@@ -148,6 +148,7 @@ export interface XeboQueuedResponse {
|
|
|
148
148
|
osVersion?: string;
|
|
149
149
|
qualityFlags?: XeboQualityFlags;
|
|
150
150
|
geolocation?: XeboGeolocation;
|
|
151
|
+
deviceInfo?: XeboDeviceInfo;
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
// ─── Config ───────────────────────────────────────────────────────────────────
|