react-native-visit-rn-sdk 6.0.4 → 7.1.0

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.
Files changed (79) hide show
  1. package/README.md +297 -191
  2. package/android/build.gradle +4 -1
  3. package/android/gradle.properties +4 -4
  4. package/android/src/main/AndroidManifest.xml +11 -5
  5. package/android/src/main/AndroidManifestNew.xml +11 -5
  6. package/android/src/main/java/com/visitrnsdk/VisitFitnessModule.kt +642 -0
  7. package/android/src/main/java/com/visitrnsdk/VisitRnSdkPackage.kt +1 -1
  8. package/android/src/main/java/com/visitrnsdk/VisitSessionStorage.kt +50 -0
  9. package/ios/VisitRnSdkViewManager.h +23 -1
  10. package/ios/VisitRnSdkViewManager.m +1259 -8
  11. package/lib/commonjs/index.android.js +328 -205
  12. package/lib/commonjs/index.android.js.map +1 -1
  13. package/lib/commonjs/index.ios.js +159 -116
  14. package/lib/commonjs/index.ios.js.map +1 -1
  15. package/lib/module/index.android.js +328 -206
  16. package/lib/module/index.android.js.map +1 -1
  17. package/lib/module/index.ios.js +161 -117
  18. package/lib/module/index.ios.js.map +1 -1
  19. package/lib/typescript/index.android.d.ts +8 -3
  20. package/lib/typescript/index.android.d.ts.map +1 -1
  21. package/lib/typescript/index.ios.d.ts +6 -3
  22. package/lib/typescript/index.ios.d.ts.map +1 -1
  23. package/package.json +18 -26
  24. package/react-native-visit-rn-sdk.podspec +2 -1
  25. package/src/index.android.js +579 -0
  26. package/src/index.ios.js +284 -0
  27. package/android/src/main/java/com/visitrnsdk/VisitRnSdkLocationModule.kt +0 -37
  28. package/lib/commonjs/assets/video-call/connecting-lottie.gif +0 -0
  29. package/lib/commonjs/assets/video-call/end-call.png +0 -0
  30. package/lib/commonjs/assets/video-call/mic-off.png +0 -0
  31. package/lib/commonjs/assets/video-call/reconnecting.gif +0 -0
  32. package/lib/commonjs/assets/video-call/switch-camera.png +0 -0
  33. package/lib/commonjs/assets/video-call/toggle-down.png +0 -0
  34. package/lib/commonjs/assets/video-call/toggle-up.png +0 -0
  35. package/lib/commonjs/assets/video-call/video-off.png +0 -0
  36. package/lib/commonjs/components/VideoCallComponent.js +0 -1088
  37. package/lib/commonjs/components/VideoCallComponent.js.map +0 -1
  38. package/lib/commonjs/index.js +0 -6
  39. package/lib/commonjs/index.js.map +0 -1
  40. package/lib/commonjs/shims.d.js +0 -2
  41. package/lib/commonjs/shims.d.js.map +0 -1
  42. package/lib/commonjs/types.js +0 -2
  43. package/lib/commonjs/types.js.map +0 -1
  44. package/lib/module/assets/video-call/connecting-lottie.gif +0 -0
  45. package/lib/module/assets/video-call/end-call.png +0 -0
  46. package/lib/module/assets/video-call/mic-off.png +0 -0
  47. package/lib/module/assets/video-call/reconnecting.gif +0 -0
  48. package/lib/module/assets/video-call/switch-camera.png +0 -0
  49. package/lib/module/assets/video-call/toggle-down.png +0 -0
  50. package/lib/module/assets/video-call/toggle-up.png +0 -0
  51. package/lib/module/assets/video-call/video-off.png +0 -0
  52. package/lib/module/components/VideoCallComponent.js +0 -1081
  53. package/lib/module/components/VideoCallComponent.js.map +0 -1
  54. package/lib/module/index.js +0 -2
  55. package/lib/module/index.js.map +0 -1
  56. package/lib/module/shims.d.js +0 -2
  57. package/lib/module/shims.d.js.map +0 -1
  58. package/lib/module/types.js +0 -2
  59. package/lib/module/types.js.map +0 -1
  60. package/lib/typescript/components/VideoCallComponent.d.ts +0 -79
  61. package/lib/typescript/components/VideoCallComponent.d.ts.map +0 -1
  62. package/lib/typescript/index.d.ts +0 -17
  63. package/lib/typescript/index.d.ts.map +0 -1
  64. package/lib/typescript/types.d.ts +0 -24
  65. package/lib/typescript/types.d.ts.map +0 -1
  66. package/src/assets/video-call/connecting-lottie.gif +0 -0
  67. package/src/assets/video-call/end-call.png +0 -0
  68. package/src/assets/video-call/mic-off.png +0 -0
  69. package/src/assets/video-call/reconnecting.gif +0 -0
  70. package/src/assets/video-call/switch-camera.png +0 -0
  71. package/src/assets/video-call/toggle-down.png +0 -0
  72. package/src/assets/video-call/toggle-up.png +0 -0
  73. package/src/assets/video-call/video-off.png +0 -0
  74. package/src/components/VideoCallComponent.tsx +0 -1484
  75. package/src/index.android.tsx +0 -459
  76. package/src/index.ios.tsx +0 -238
  77. package/src/index.tsx +0 -25
  78. package/src/shims.d.ts +0 -49
  79. package/src/types.ts +0 -25
@@ -0,0 +1,579 @@
1
+ import React, { useRef, useEffect, useState, useCallback } from 'react';
2
+ import { EventRegister } from 'react-native-event-listeners';
3
+
4
+ import {
5
+ SafeAreaView,
6
+ NativeModules,
7
+ PermissionsAndroid,
8
+ BackHandler,
9
+ Linking,
10
+ Alert,
11
+ AppState,
12
+ NativeEventEmitter,
13
+ } from 'react-native';
14
+
15
+ import WebView from 'react-native-webview';
16
+
17
+ import LocationEnabler from 'react-native-location-enabler';
18
+
19
+ const messageEmitter = new NativeEventEmitter(NativeModules.VisitFitnessModule);
20
+
21
+ const {
22
+ PRIORITIES: { HIGH_ACCURACY },
23
+ useLocationSettings,
24
+ addListener,
25
+ } = LocationEnabler;
26
+
27
+ /** @param {{ ssoURL: string, isLoggingEnabled?: boolean }} props */
28
+ const VisitRnSdkView = ({ ssoURL, isLoggingEnabled = false }) => {
29
+ const source = ssoURL?.trim();
30
+ const [appState, setAppState] = useState(AppState.currentState);
31
+
32
+ const [
33
+ showPermissionAlreadyDeniedDialog,
34
+ setShowPermissionAlreadyDeniedDialog,
35
+ ] = useState(false);
36
+
37
+ useEffect(() => {
38
+ if (isLoggingEnabled) {
39
+ console.log('useEffect ran');
40
+ }
41
+
42
+ NativeModules.VisitFitnessModule.initiateSDK(isLoggingEnabled);
43
+ }, [isLoggingEnabled]);
44
+
45
+ useEffect(() => {
46
+ const subscription = messageEmitter.addListener('onMessage', (message) => {
47
+ console.log('Received message:', message);
48
+
49
+ if (typeof message === 'string' && message.includes('RemoteException')) {
50
+ Alert.alert(
51
+ 'Error!',
52
+ 'Something went wrong while connecting to Health Connect. Please try again.',
53
+ []
54
+ );
55
+ }
56
+
57
+ EventRegister.emitEvent('visit-event', {
58
+ message: 'health-connect-error-event',
59
+ errorMessage: message,
60
+ });
61
+ });
62
+
63
+ return () => {
64
+ // Clean up the subscription when the component unmounts
65
+ subscription.remove();
66
+ };
67
+ }, []);
68
+
69
+ useEffect(() => {
70
+ const subscription = AppState.addEventListener('change', (nextAppState) => {
71
+ if (appState?.match(/inactive|background/) && nextAppState === 'active') {
72
+ if (isLoggingEnabled) {
73
+ console.log('App has come to the foreground!');
74
+ }
75
+ console.log(
76
+ 'getHealthConnectStatus commented out, because it it not required for MCHI since we rely on callback from the web to get the health connect status.'
77
+ );
78
+ }
79
+
80
+ setAppState(nextAppState);
81
+ });
82
+ console.log(`AppState.addEventListener added, current state: ${appState}`);
83
+
84
+ return () => {
85
+ subscription.remove();
86
+ };
87
+ }, [appState, isLoggingEnabled]);
88
+
89
+ const [enabled, requestResolution] = useLocationSettings(
90
+ {
91
+ priority: HIGH_ACCURACY, // default BALANCED_POWER_ACCURACY
92
+ alwaysShow: true, // default false
93
+ needBle: true, // default false
94
+ },
95
+ false /* optional: default undefined */
96
+ );
97
+
98
+ const webviewRef = useRef(null);
99
+
100
+ const showLocationPermissionAlert = () => {
101
+ Alert.alert(
102
+ 'Permission Required',
103
+ 'Allow location permission from app settings',
104
+ [
105
+ {
106
+ text: 'Cancel',
107
+ onPress: () => {
108
+ console.log('Cancel clicked');
109
+ },
110
+ },
111
+ {
112
+ text: 'Go to Settings',
113
+ onPress: () => {
114
+ Linking.openSettings();
115
+ },
116
+ },
117
+ ]
118
+ );
119
+ };
120
+
121
+ const requestLocationPermission = async () => {
122
+ try {
123
+ console.log('requestLocationPermission called');
124
+
125
+ const isLocationPermissionPresent = await PermissionsAndroid.check(
126
+ PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION
127
+ );
128
+
129
+ console.log(
130
+ 'isLocationPermissionPresent: ' +
131
+ isLocationPermissionPresent +
132
+ ' showPermissionAlreadyDeniedDialog: ' +
133
+ showPermissionAlreadyDeniedDialog
134
+ );
135
+
136
+ if (!isLocationPermissionPresent && showPermissionAlreadyDeniedDialog) {
137
+ console.log('showLocationPermissionAlert() called');
138
+
139
+ showLocationPermissionAlert();
140
+ } else {
141
+ console.log('requesting location permission');
142
+
143
+ const granted = await PermissionsAndroid.request(
144
+ PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
145
+ {
146
+ title: 'Need Location Permission',
147
+ message: 'Need access to location permission',
148
+ buttonNeutral: 'Ask Me Later',
149
+ buttonNegative: 'Cancel',
150
+ buttonPositive: 'OK',
151
+ }
152
+ );
153
+ if (granted === PermissionsAndroid.RESULTS.GRANTED) {
154
+ if (isLoggingEnabled) {
155
+ console.log('Location permission granted');
156
+ }
157
+ setShowPermissionAlreadyDeniedDialog(false);
158
+
159
+ if (!enabled) {
160
+ requestResolution();
161
+ } else {
162
+ var finalString = `window.checkTheGpsPermission(true)`;
163
+ console.log('requestLocationPermission: ' + finalString);
164
+
165
+ webviewRef.current?.injectJavaScript(finalString);
166
+ }
167
+ } else {
168
+ setShowPermissionAlreadyDeniedDialog(true);
169
+ console.log('Location permission denied');
170
+
171
+ var finalString = `window.checkTheGpsPermission(false)`;
172
+ console.log('requestLocationPermission: ' + finalString);
173
+
174
+ webviewRef.current?.injectJavaScript(finalString);
175
+ }
176
+ }
177
+ } catch (e) {
178
+ console.error(e);
179
+ }
180
+ };
181
+
182
+ const showHealthConnectPermissionDeniedDialog = () => {
183
+ Alert.alert(
184
+ 'Permission Denied',
185
+ 'Go to Health Connect App to allow app permission',
186
+ [
187
+ {
188
+ text: 'Cancel',
189
+ onPress: () => {
190
+ console.log('Cancel clicked');
191
+ },
192
+ },
193
+ {
194
+ text: 'Open Health Connect',
195
+ onPress: () => {
196
+ openHealthConnectApp();
197
+ },
198
+ },
199
+ ]
200
+ );
201
+ };
202
+
203
+ const openHealthConnectApp = async () => {
204
+ NativeModules.VisitFitnessModule.openHealthConnectApp();
205
+ };
206
+
207
+ const askForHealthConnectPermission = async () => {
208
+ try {
209
+ const isPermissionGranted =
210
+ await NativeModules.VisitFitnessModule.askForFitnessPermission();
211
+
212
+ if (isLoggingEnabled) {
213
+ console.log('isPermissionGranted: ' + isPermissionGranted);
214
+ }
215
+
216
+ if (isPermissionGranted === 'GRANTED') {
217
+ getHealthConnectStatus();
218
+ // getDailyFitnessData();
219
+ } else if (isPermissionGranted === 'CANCELLED') {
220
+ showHealthConnectPermissionDeniedDialog();
221
+ }
222
+ } catch (e) {
223
+ if (isLoggingEnabled) {
224
+ console.error(e);
225
+ }
226
+ }
227
+ };
228
+
229
+ const getHealthConnectStatus = async () => {
230
+ try {
231
+ const healthConnectStatus =
232
+ await NativeModules.VisitFitnessModule.getHealthConnectStatus();
233
+
234
+ if (isLoggingEnabled) {
235
+ console.log('getHealthConnectStatus: ' + healthConnectStatus);
236
+ }
237
+
238
+ if (healthConnectStatus === 'NOT_SUPPORTED') {
239
+ webviewRef.current?.injectJavaScript(
240
+ 'window.healthConnectNotSupported()'
241
+ );
242
+ } else if (healthConnectStatus === 'NOT_INSTALLED') {
243
+ webviewRef.current?.injectJavaScript(
244
+ 'window.healthConnectNotInstall()'
245
+ );
246
+ webviewRef.current?.injectJavaScript(
247
+ 'window.updateFitnessPermissions(false,0,0)'
248
+ );
249
+ } else if (healthConnectStatus === 'INSTALLED') {
250
+ webviewRef.current?.injectJavaScript('window.healthConnectAvailable()');
251
+
252
+ webviewRef.current?.injectJavaScript(
253
+ 'window.updateFitnessPermissions(false,0,0)'
254
+ );
255
+ } else if (healthConnectStatus === 'CONNECTED') {
256
+ getDailyFitnessData();
257
+ }
258
+ } catch (e) {
259
+ if (isLoggingEnabled) {
260
+ console.error(e);
261
+ }
262
+ }
263
+ };
264
+
265
+ const getDailyFitnessData = async () => {
266
+ if (isLoggingEnabled) {
267
+ console.log('getDailyFitnessData() called');
268
+ }
269
+
270
+ try {
271
+ const dailyFitnessData =
272
+ await NativeModules.VisitFitnessModule.requestDailyFitnessData();
273
+
274
+ if (dailyFitnessData) {
275
+ webviewRef.current?.injectJavaScript(dailyFitnessData);
276
+ }
277
+ } catch (error) {
278
+ if (isLoggingEnabled) {
279
+ console.log(error);
280
+ }
281
+ }
282
+ };
283
+
284
+ const requestActivityData = async (type, frequency, timeStamp) => {
285
+ if (isLoggingEnabled) {
286
+ console.log('requestActivityData() called');
287
+ }
288
+
289
+ try {
290
+ const graphData =
291
+ await NativeModules.VisitFitnessModule.requestActivityDataFromHealthConnect(
292
+ type,
293
+ frequency,
294
+ timeStamp
295
+ );
296
+
297
+ if (isLoggingEnabled) {
298
+ console.log(`requestActivityData() data: ` + graphData);
299
+ }
300
+
301
+ if (graphData) {
302
+ webviewRef.current?.injectJavaScript('window.' + graphData);
303
+ }
304
+ } catch (error) {
305
+ if (isLoggingEnabled) {
306
+ console.log(error);
307
+ }
308
+ }
309
+ };
310
+
311
+ const updateApiBaseUrl = async (
312
+ apiBaseUrl,
313
+ authtoken,
314
+ googleFitLastSync,
315
+ gfHourlyLastSync
316
+ ) => {
317
+ if (isLoggingEnabled) {
318
+ console.log('updateApiBaseUrl() called.');
319
+ }
320
+
321
+ try {
322
+ const message = await NativeModules.VisitFitnessModule.updateApiBaseUrl(
323
+ apiBaseUrl,
324
+ authtoken,
325
+ googleFitLastSync,
326
+ gfHourlyLastSync
327
+ );
328
+
329
+ if (isLoggingEnabled) {
330
+ console.log(message);
331
+ }
332
+ } catch (error) {
333
+ if (isLoggingEnabled) {
334
+ console.log(error);
335
+ }
336
+ }
337
+ };
338
+
339
+ const runBeforeFirst = `
340
+ window.isNativeApp = true;
341
+ window.platform = "ANDROID";
342
+ window.setSdkPlatform('ANDROID');
343
+ true; // note: this is required, or you'll sometimes get silent failures
344
+ `;
345
+
346
+ const handleMessage = (event) => {
347
+ if (event.nativeEvent.data != null) {
348
+ try {
349
+ if (isLoggingEnabled) {
350
+ console.log('Event :' + event.nativeEvent.data);
351
+ }
352
+ const parsedObject = JSON.parse(event.nativeEvent.data);
353
+ if (parsedObject.method != null) {
354
+ switch (parsedObject.method) {
355
+ case 'GET_HEALTH_CONNECT_STATUS':
356
+ getHealthConnectStatus();
357
+ break;
358
+ case 'CONNECT_TO_GOOGLE_FIT':
359
+ askForHealthConnectPermission();
360
+ break;
361
+ case 'UPDATE_PLATFORM':
362
+ webviewRef.current?.injectJavaScript(
363
+ 'window.setSdkPlatform("ANDROID")'
364
+ );
365
+ break;
366
+ case 'UPDATE_API_BASE_URL':
367
+ {
368
+ let apiBaseUrl = parsedObject.apiBaseUrl;
369
+ let authtoken = parsedObject.authtoken;
370
+
371
+ let googleFitLastSync = parsedObject.googleFitLastSync;
372
+ let gfHourlyLastSync = parsedObject.gfHourlyLastSync;
373
+
374
+ if (isLoggingEnabled) {
375
+ console.log(
376
+ 'apiBaseUrl: ' +
377
+ 'NOT SHOWN' +
378
+ ' authtoken: ' +
379
+ 'NOT SHOWN' +
380
+ ' googleFitLastSync: ' +
381
+ googleFitLastSync +
382
+ ' gfHourlyLastSync: ' +
383
+ gfHourlyLastSync
384
+ );
385
+ }
386
+
387
+ updateApiBaseUrl(
388
+ apiBaseUrl,
389
+ authtoken,
390
+ googleFitLastSync,
391
+ gfHourlyLastSync
392
+ );
393
+ }
394
+ break;
395
+ case 'GET_DATA_TO_GENERATE_GRAPH':
396
+ {
397
+ let type = parsedObject.type;
398
+ let frequency = parsedObject.frequency;
399
+ let timeStamp = parsedObject.timestamp;
400
+
401
+ if (isLoggingEnabled) {
402
+ console.log(
403
+ 'type: ' +
404
+ type +
405
+ ' frequency:' +
406
+ frequency +
407
+ ' timeStamp: ' +
408
+ timeStamp
409
+ );
410
+ }
411
+
412
+ requestActivityData(type, frequency, timeStamp);
413
+ }
414
+ break;
415
+ case 'GET_LOCATION_PERMISSIONS':
416
+ console.log('GET_LOCATION_PERMISSIONS');
417
+ requestLocationPermission();
418
+ break;
419
+ case 'OPEN_PDF':
420
+ {
421
+ let pdfUrl = parsedObject.url;
422
+ // console.log("pdfUrl "+pdfUrl);
423
+
424
+ Linking.openURL(pdfUrl);
425
+ }
426
+ break;
427
+ case 'OPEN_FACE_SCAN_FLOW':
428
+ EventRegister.emitEvent('visit-event', {
429
+ message: 'OPEN_FACE_SCAN_FLOW',
430
+ });
431
+ break;
432
+ case 'CLOSE_VIEW':
433
+ break;
434
+
435
+ default:
436
+ break;
437
+ }
438
+ }
439
+ } catch (exception) {
440
+ console.log('Exception occured:' + exception.message);
441
+ }
442
+ }
443
+ };
444
+
445
+ const [canGoBack, setCanGoBack] = useState(false);
446
+
447
+ const handleBack = useCallback(() => {
448
+ if (canGoBack && webviewRef.current) {
449
+ webviewRef.current?.goBack();
450
+ return true;
451
+ }
452
+ return false;
453
+ }, [canGoBack]);
454
+
455
+ useEffect(() => {
456
+ const checkLocationPermissionAndSendCallback = async () => {
457
+ const isLocationPermissionAvailable = await PermissionsAndroid.check(
458
+ PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION
459
+ );
460
+
461
+ if (isLoggingEnabled) {
462
+ console.log(
463
+ 'checkLocationPermissionAndSendCallback() isLocationPermissionAvailable: ' +
464
+ isLocationPermissionAvailable +
465
+ 'isGPSPermissionAvailabe: true'
466
+ );
467
+ }
468
+
469
+ if (isLocationPermissionAvailable) {
470
+ var finalString = `window.checkTheGpsPermission(true)`;
471
+
472
+ console.log('listener: ' + finalString);
473
+
474
+ webviewRef.current?.injectJavaScript(finalString);
475
+ }
476
+ };
477
+
478
+ // Subscribe to GPS/location setting changes
479
+ const locationSub = addListener(({ locationEnabled }) => {
480
+ if (locationEnabled) {
481
+ checkLocationPermissionAndSendCallback();
482
+ }
483
+ });
484
+
485
+ // Subscribe to Android hardware back press
486
+ const backSub = BackHandler.addEventListener(
487
+ 'hardwareBackPress',
488
+ handleBack
489
+ );
490
+
491
+ // Cleanup subscriptions on unmount
492
+ return () => {
493
+ backSub?.remove();
494
+ locationSub?.remove();
495
+ };
496
+ }, [handleBack, isLoggingEnabled]);
497
+
498
+ return (
499
+ // eslint-disable-next-line react-native/no-inline-styles
500
+ <SafeAreaView style={{ flex: 1 }}>
501
+ {source ? (
502
+ <WebView
503
+ ref={webviewRef}
504
+ source={{
505
+ uri: source,
506
+ headers: {
507
+ platform: 'ANDROID',
508
+ },
509
+ }}
510
+ onMessage={handleMessage}
511
+ injectedJavaScriptBeforeContentLoaded={runBeforeFirst}
512
+ javaScriptEnabled={true}
513
+ onLoadProgress={(event) => setCanGoBack(event.nativeEvent.canGoBack)}
514
+ onError={(errorMessage) => {
515
+ EventRegister.emitEvent('visit-event', {
516
+ message: 'web-view-error',
517
+ errorMessage: errorMessage,
518
+ });
519
+ if (isLoggingEnabled) {
520
+ console.warn('Webview error: ', errorMessage);
521
+ }
522
+ }}
523
+ />
524
+ ) : null}
525
+ </SafeAreaView>
526
+ );
527
+ };
528
+
529
+ export const fetchDailyFitnessData = (startTimeStamp, isLoggingEnabled) => {
530
+ return new Promise((resolve, reject) => {
531
+ console.log('fetchDailyFitnessData called: ' + startTimeStamp);
532
+
533
+ NativeModules.VisitFitnessModule.fetchDailyFitnessData(startTimeStamp)
534
+ .then((result) => {
535
+ resolve(result);
536
+ })
537
+ .catch((err) => reject(err));
538
+ });
539
+ };
540
+
541
+ export const fetchHourlyFitnessData = (startTimeStamp, isLoggingEnabled) => {
542
+ return new Promise((resolve, reject) => {
543
+ if (isLoggingEnabled) {
544
+ console.log('fetchHourlyFitnessData called: ' + startTimeStamp);
545
+ }
546
+
547
+ NativeModules.VisitFitnessModule.fetchHourlyFitnessData(startTimeStamp)
548
+ .then((result) => {
549
+ resolve(result);
550
+ })
551
+ .catch((err) => reject(err));
552
+ });
553
+ };
554
+
555
+ // debounce, deferred
556
+ // function debounce(task, ms) {
557
+ // let t = { promise: null, cancel: (_) => void 0 };
558
+ // return async (...args) => {
559
+ // try {
560
+ // t.cancel();
561
+ // t = deferred(ms);
562
+ // await t.promise;
563
+ // await task(...args);
564
+ // } catch (_) {
565
+ // console.log('cleaning up cancelled promise');
566
+ // }
567
+ // };
568
+ // }
569
+
570
+ // function deferred(ms) {
571
+ // let cancel,
572
+ // promise = new Promise((resolve, reject) => {
573
+ // cancel = reject;
574
+ // setTimeout(resolve, ms);
575
+ // });
576
+ // return { promise, cancel };
577
+ // }
578
+
579
+ export default VisitRnSdkView;