react-native-mytatva-rn-sdk 1.0.0 → 1.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.
- package/android/app/build.gradle +5 -0
- package/android/build.gradle +5 -5
- package/android/gradle.properties +13 -5
- package/android/settings.gradle +9 -0
- package/android/src/main/AndroidManifest.xml +22 -1
- package/android/src/main/AndroidManifestNew.xml +59 -1
- package/android/src/main/java/com/{visitrnsdk/VisitRnSdkPackage.kt → mytatvarnsdk/MyTatvaRnSdkPackage.kt} +2 -2
- package/android/src/main/java/com/{visitrnsdk/VisitRnSdkViewManager.kt → mytatvarnsdk/MyTatvaRnSdkViewManager.kt} +1 -1
- package/lib/commonjs/BcaDeviceListSheet.js +286 -0
- package/lib/commonjs/BcaDeviceListSheet.js.map +1 -0
- package/lib/commonjs/MainWebView.js +68 -0
- package/lib/commonjs/MainWebView.js.map +1 -0
- package/lib/commonjs/ProgressWebView.js +547 -0
- package/lib/commonjs/ProgressWebView.js.map +1 -0
- package/lib/commonjs/Services.js +27 -1
- package/lib/commonjs/Services.js.map +1 -1
- package/lib/commonjs/Sheets.js +7 -0
- package/lib/commonjs/Sheets.js.map +1 -0
- package/lib/commonjs/api/auth.js +167 -0
- package/lib/commonjs/api/auth.js.map +1 -0
- package/lib/commonjs/api/base.js +224 -0
- package/lib/commonjs/api/base.js.map +1 -0
- package/lib/commonjs/api/index.js +12 -0
- package/lib/commonjs/api/index.js.map +1 -0
- package/lib/commonjs/assets/icons/achieve.svg +3 -0
- package/lib/commonjs/assets/icons/heart.svg +3 -0
- package/lib/commonjs/assets/icons/smartWatch.svg +3 -0
- package/lib/commonjs/constants/asyncstorage.js +29 -0
- package/lib/commonjs/constants/asyncstorage.js.map +1 -0
- package/lib/commonjs/constants/constants.js +1373 -0
- package/lib/commonjs/constants/constants.js.map +1 -0
- package/lib/commonjs/constants.js +12 -2
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/helpers/Matrics.js +49 -0
- package/lib/commonjs/helpers/Matrics.js.map +1 -0
- package/lib/commonjs/helpers/bluetoothPermissionHelper.js +114 -0
- package/lib/commonjs/helpers/bluetoothPermissionHelper.js.map +1 -0
- package/lib/commonjs/helpers/colors.js +304 -0
- package/lib/commonjs/helpers/colors.js.map +1 -0
- package/lib/commonjs/helpers/common.js +46 -0
- package/lib/commonjs/helpers/common.js.map +1 -0
- package/lib/commonjs/helpers/fonts.js +33 -0
- package/lib/commonjs/helpers/fonts.js.map +1 -0
- package/lib/commonjs/helpers/globalStyles.js +188 -0
- package/lib/commonjs/helpers/globalStyles.js.map +1 -0
- package/lib/commonjs/helpers/icons.js +16 -0
- package/lib/commonjs/helpers/icons.js.map +1 -0
- package/lib/commonjs/index.android.js +163 -414
- package/lib/commonjs/index.android.js.map +1 -1
- package/lib/commonjs/index.ios.js +138 -187
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/redux/Store.js +42 -0
- package/lib/commonjs/redux/Store.js.map +1 -0
- package/lib/commonjs/redux/hooks.js +8 -0
- package/lib/commonjs/redux/hooks.js.map +1 -0
- package/lib/commonjs/redux/sagas/AuthSaga.js +44 -0
- package/lib/commonjs/redux/sagas/AuthSaga.js.map +1 -0
- package/lib/commonjs/redux/sagas/index.js +15 -0
- package/lib/commonjs/redux/sagas/index.js.map +1 -0
- package/lib/commonjs/redux/slices/authSlice.js +80 -0
- package/lib/commonjs/redux/slices/authSlice.js.map +1 -0
- package/lib/commonjs/redux/slices/index.js +44 -0
- package/lib/commonjs/redux/slices/index.js.map +1 -0
- package/lib/commonjs/types/auth.js +2 -0
- package/lib/commonjs/types/auth.js.map +1 -0
- package/lib/commonjs/types/common.js +2 -0
- package/lib/commonjs/types/common.js.map +1 -0
- package/lib/commonjs/types/index.js +13 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/module/BcaDeviceListSheet.js +277 -0
- package/lib/module/BcaDeviceListSheet.js.map +1 -0
- package/lib/module/MainWebView.js +61 -0
- package/lib/module/MainWebView.js.map +1 -0
- package/lib/module/ProgressWebView.js +536 -0
- package/lib/module/ProgressWebView.js.map +1 -0
- package/lib/module/Services.js +24 -0
- package/lib/module/Services.js.map +1 -1
- package/lib/module/Sheets.js +4 -0
- package/lib/module/Sheets.js.map +1 -0
- package/lib/module/api/auth.js +160 -0
- package/lib/module/api/auth.js.map +1 -0
- package/lib/module/api/base.js +212 -0
- package/lib/module/api/base.js.map +1 -0
- package/lib/module/api/index.js +5 -0
- package/lib/module/api/index.js.map +1 -0
- package/lib/module/assets/icons/achieve.svg +3 -0
- package/lib/module/assets/icons/heart.svg +3 -0
- package/lib/module/assets/icons/smartWatch.svg +3 -0
- package/lib/module/constants/asyncstorage.js +23 -0
- package/lib/module/constants/asyncstorage.js.map +1 -0
- package/lib/module/constants/constants.js +1367 -0
- package/lib/module/constants/constants.js.map +1 -0
- package/lib/module/constants.js +12 -2
- package/lib/module/constants.js.map +1 -1
- package/lib/module/helpers/Matrics.js +44 -0
- package/lib/module/helpers/Matrics.js.map +1 -0
- package/lib/module/helpers/bluetoothPermissionHelper.js +103 -0
- package/lib/module/helpers/bluetoothPermissionHelper.js.map +1 -0
- package/lib/module/helpers/colors.js +298 -0
- package/lib/module/helpers/colors.js.map +1 -0
- package/lib/module/helpers/common.js +34 -0
- package/lib/module/helpers/common.js.map +1 -0
- package/lib/module/helpers/fonts.js +27 -0
- package/lib/module/helpers/fonts.js.map +1 -0
- package/lib/module/helpers/globalStyles.js +181 -0
- package/lib/module/helpers/globalStyles.js.map +1 -0
- package/lib/module/helpers/icons.js +9 -0
- package/lib/module/helpers/icons.js.map +1 -0
- package/lib/module/index.android.js +165 -413
- package/lib/module/index.android.js.map +1 -1
- package/lib/module/index.ios.js +138 -187
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/redux/Store.js +34 -0
- package/lib/module/redux/Store.js.map +1 -0
- package/lib/module/redux/hooks.js +7 -0
- package/lib/module/redux/hooks.js.map +1 -0
- package/lib/module/redux/sagas/AuthSaga.js +34 -0
- package/lib/module/redux/sagas/AuthSaga.js.map +1 -0
- package/lib/module/redux/sagas/index.js +8 -0
- package/lib/module/redux/sagas/index.js.map +1 -0
- package/lib/module/redux/slices/authSlice.js +68 -0
- package/lib/module/redux/slices/authSlice.js.map +1 -0
- package/lib/module/redux/slices/index.js +24 -0
- package/lib/module/redux/slices/index.js.map +1 -0
- package/lib/module/types/auth.js +2 -0
- package/lib/module/types/auth.js.map +1 -0
- package/lib/module/types/common.js +2 -0
- package/lib/module/types/common.js.map +1 -0
- package/lib/module/types/index.js +4 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/typescript/BcaDeviceListSheet.d.ts +7 -0
- package/lib/typescript/BcaDeviceListSheet.d.ts.map +1 -0
- package/lib/typescript/MainWebView.d.ts +4 -0
- package/lib/typescript/MainWebView.d.ts.map +1 -0
- package/lib/typescript/ProgressWebView.d.ts +4 -0
- package/lib/typescript/ProgressWebView.d.ts.map +1 -0
- package/lib/typescript/Services.d.ts +5 -0
- package/lib/typescript/Services.d.ts.map +1 -0
- package/lib/typescript/Sheets.d.ts +2 -0
- package/lib/typescript/Sheets.d.ts.map +1 -0
- package/lib/typescript/api/auth.d.ts +33 -0
- package/lib/typescript/api/auth.d.ts.map +1 -0
- package/lib/typescript/api/base.d.ts +20 -0
- package/lib/typescript/api/base.d.ts.map +1 -0
- package/lib/typescript/api/index.d.ts +35 -0
- package/lib/typescript/api/index.d.ts.map +1 -0
- package/lib/typescript/constants/asyncstorage.d.ts +23 -0
- package/lib/typescript/constants/asyncstorage.d.ts.map +1 -0
- package/lib/typescript/constants/constants.d.ts +1081 -0
- package/lib/typescript/constants/constants.d.ts.map +1 -0
- package/lib/typescript/constants.d.ts +16 -0
- package/lib/typescript/constants.d.ts.map +1 -0
- package/lib/typescript/helpers/Matrics.d.ts +14 -0
- package/lib/typescript/helpers/Matrics.d.ts.map +1 -0
- package/lib/typescript/helpers/bluetoothPermissionHelper.d.ts +18 -0
- package/lib/typescript/helpers/bluetoothPermissionHelper.d.ts.map +1 -0
- package/lib/typescript/helpers/colors.d.ts +297 -0
- package/lib/typescript/helpers/colors.d.ts.map +1 -0
- package/lib/typescript/helpers/common.d.ts +8 -0
- package/lib/typescript/helpers/common.d.ts.map +1 -0
- package/lib/typescript/helpers/fonts.d.ts +23 -0
- package/lib/typescript/helpers/fonts.d.ts.map +1 -0
- package/lib/typescript/helpers/globalStyles.d.ts +176 -0
- package/lib/typescript/helpers/globalStyles.d.ts.map +1 -0
- package/lib/typescript/helpers/icons.d.ts +6 -0
- package/lib/typescript/helpers/icons.d.ts.map +1 -0
- package/lib/typescript/index.android.d.ts +30 -0
- package/lib/typescript/index.android.d.ts.map +1 -0
- package/lib/typescript/index.ios.d.ts +28 -0
- package/lib/typescript/index.ios.d.ts.map +1 -0
- package/lib/typescript/redux/Store.d.ts +13 -0
- package/lib/typescript/redux/Store.d.ts.map +1 -0
- package/lib/typescript/redux/hooks.d.ts +1 -0
- package/lib/typescript/redux/hooks.d.ts.map +1 -0
- package/lib/typescript/redux/sagas/AuthSaga.d.ts +3 -0
- package/lib/typescript/redux/sagas/AuthSaga.d.ts.map +1 -0
- package/lib/typescript/redux/sagas/index.d.ts +3 -0
- package/lib/typescript/redux/sagas/index.d.ts.map +1 -0
- package/lib/typescript/redux/slices/authSlice.d.ts +5 -0
- package/lib/typescript/redux/slices/authSlice.d.ts.map +1 -0
- package/lib/typescript/redux/slices/index.d.ts +6 -0
- package/lib/typescript/redux/slices/index.d.ts.map +1 -0
- package/lib/typescript/types/auth.d.ts +485 -0
- package/lib/typescript/types/auth.d.ts.map +1 -0
- package/lib/typescript/types/common.d.ts +19 -0
- package/lib/typescript/types/common.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +4 -0
- package/lib/typescript/types/index.d.ts.map +1 -0
- package/package.json +39 -8
- package/src/BcaDeviceListSheet.tsx +331 -0
- package/src/MainWebView.tsx +67 -0
- package/src/ProgressWebView.tsx +602 -0
- package/src/Services.js +40 -0
- package/src/Sheets.js +4 -0
- package/src/api/auth.ts +156 -0
- package/src/api/base.ts +247 -0
- package/src/api/index.ts +5 -0
- package/src/assets/icons/achieve.svg +3 -0
- package/src/assets/icons/heart.svg +3 -0
- package/src/assets/icons/smartWatch.svg +3 -0
- package/src/constants/asyncstorage.ts +23 -0
- package/src/constants/constants.ts +1204 -0
- package/src/constants.ts +14 -0
- package/src/helpers/Matrics.ts +48 -0
- package/src/helpers/bluetoothPermissionHelper.ts +198 -0
- package/src/helpers/colors.ts +320 -0
- package/src/helpers/common.ts +46 -0
- package/src/helpers/fonts.ts +28 -0
- package/src/helpers/globalStyles.ts +179 -0
- package/src/helpers/icons.ts +11 -0
- package/src/index.android.js +164 -577
- package/src/index.ios.js +147 -215
- package/src/redux/Store.ts +36 -0
- package/src/redux/hooks.ts +6 -0
- package/src/redux/sagas/AuthSaga.ts +49 -0
- package/src/redux/sagas/index.ts +9 -0
- package/src/redux/slices/authSlice.ts +81 -0
- package/src/redux/slices/index.ts +29 -0
- package/src/types/auth.ts +533 -0
- package/src/types/common.ts +19 -0
- package/src/types/index.ts +8 -0
- package/lib/typescript/index.test.d.ts +0 -1
- package/lib/typescript/index.test.d.ts.map +0 -1
- package/src/constants.js +0 -4
- /package/ios/{VisitRnSdk.xcodeproj → MyTatvaRnSdk.xcodeproj}/project.pbxproj +0 -0
- /package/ios/{VisitRnSdkViewManager.h → MyTatvaRnSdkViewManager.h} +0 -0
- /package/ios/{VisitRnSdkViewManager.m → MyTatvaRnSdkViewManager.m} +0 -0
- /package/{react-native-visit-rn-sdk.podspec → react-native-mytatva-rn-sdk.podspec} +0 -0
|
@@ -1,131 +1,81 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useState, useCallback } from 'react';
|
|
2
2
|
import { EventRegister } from 'react-native-event-listeners';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import
|
|
3
|
+
import { NavigationContainer } from '@react-navigation/native';
|
|
4
|
+
// import { createStackNavigator } from '@react-navigation/stack';
|
|
5
|
+
|
|
6
|
+
import { SafeAreaView, BackHandler, Linking, AppState, ActivityIndicator, View, Text } from 'react-native';
|
|
7
|
+
import '../src/Sheets';
|
|
8
|
+
import { Provider } from 'react-redux';
|
|
9
|
+
import { configureStore } from '@reduxjs/toolkit';
|
|
10
|
+
import createSagaMiddleware from '@redux-saga/core';
|
|
11
|
+
import rootReducer from './redux/slices';
|
|
12
|
+
import rootSaga from './redux/sagas';
|
|
13
|
+
|
|
14
|
+
// import {enableScreens} from 'react-native-screens';
|
|
15
|
+
|
|
7
16
|
import axios from 'axios';
|
|
8
17
|
import constants from './constants';
|
|
18
|
+
import { getEncryptedText, getDecryptedData } from './Services';
|
|
19
|
+
import MainWebView from './MainWebView';
|
|
20
|
+
import ProgressWebView from './ProgressWebView';
|
|
21
|
+
import { SheetManager, SheetProvider } from 'react-native-actions-sheet';
|
|
22
|
+
|
|
23
|
+
// enableScreens();
|
|
24
|
+
|
|
25
|
+
// const Stack = createStackNavigator();
|
|
26
|
+
|
|
9
27
|
export const httpClient = axios.create({
|
|
10
|
-
timeout: 60000
|
|
28
|
+
timeout: 60000,
|
|
29
|
+
headers: {
|
|
30
|
+
'api-key': 'lChjFRJce3bxmoS3TSQk5w==',
|
|
31
|
+
'Content-Type': 'text/plain'
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const sagaMiddleware = createSagaMiddleware();
|
|
35
|
+
const store = configureStore({
|
|
36
|
+
reducer: rootReducer,
|
|
37
|
+
middleware: getDefaultMiddleware => getDefaultMiddleware().concat(sagaMiddleware)
|
|
11
38
|
});
|
|
12
|
-
|
|
13
|
-
PRIORITIES: {
|
|
14
|
-
HIGH_ACCURACY
|
|
15
|
-
},
|
|
16
|
-
useLocationSettings,
|
|
17
|
-
addListener
|
|
18
|
-
} = LocationEnabler;
|
|
39
|
+
sagaMiddleware.run(rootSaga);
|
|
19
40
|
const MyTatvaRnSdkView = ({
|
|
20
|
-
|
|
41
|
+
mobileNumber,
|
|
42
|
+
uuid,
|
|
21
43
|
baseUrl,
|
|
22
44
|
errorBaseUrl,
|
|
23
45
|
token,
|
|
24
|
-
moduleName,
|
|
25
46
|
environment,
|
|
26
|
-
|
|
27
|
-
|
|
47
|
+
userMetaInfo,
|
|
48
|
+
clientSource,
|
|
49
|
+
moduleName,
|
|
50
|
+
navigation
|
|
28
51
|
}) => {
|
|
29
52
|
const [source, setSource] = useState('');
|
|
30
53
|
const [appState, setAppState] = useState(AppState.currentState);
|
|
31
|
-
const [
|
|
54
|
+
const [loading, setLoading] = useState(false);
|
|
55
|
+
const [isError, setError] = useState(false);
|
|
56
|
+
|
|
57
|
+
// useEffect(() => {
|
|
58
|
+
// if ((baseUrl?.trim()?.length || 0) > 0) {
|
|
59
|
+
// setSource(baseUrl);
|
|
60
|
+
// }
|
|
61
|
+
// }, [
|
|
62
|
+
// baseUrl,
|
|
63
|
+
// ]);
|
|
64
|
+
|
|
32
65
|
useEffect(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (((magicLink === null || magicLink === void 0 || (_magicLink$trim = magicLink.trim()) === null || _magicLink$trim === void 0 ? void 0 : _magicLink$trim.length) || 0) > 0) {
|
|
39
|
-
setSource(magicLink);
|
|
40
|
-
} else {
|
|
41
|
-
DeviceInfo.getAndroidId().then(deviceId => {
|
|
42
|
-
var buildNumber = DeviceInfo.getBuildNumber();
|
|
43
|
-
let systemVersion = DeviceInfo.getSystemVersion();
|
|
44
|
-
let version = DeviceInfo.getVersion();
|
|
45
|
-
if (isLoggingEnabled) {
|
|
46
|
-
console.log(' baseUrl : ' + baseUrl + 'token: ' + token + ' cpsid: ' + cpsid + ' environment: ' + environment + 'buildNumber:' + buildNumber + ' systemVersion:' + systemVersion + ' version : ' + version + ' deviceId', deviceId);
|
|
47
|
-
}
|
|
48
|
-
var finalEndPoint = `${baseUrl}/partners/v3/generate-magic-link-star-health`;
|
|
49
|
-
if (isLoggingEnabled) {
|
|
50
|
-
console.log('finalEndPoint: ' + finalEndPoint);
|
|
51
|
-
}
|
|
52
|
-
httpClient.post(finalEndPoint, {
|
|
53
|
-
cpsid: cpsid,
|
|
54
|
-
token: token,
|
|
55
|
-
srcClientId: 'Android',
|
|
56
|
-
deviceId: deviceId,
|
|
57
|
-
appVersion: version,
|
|
58
|
-
deviceVersion: systemVersion,
|
|
59
|
-
userEnv: environment
|
|
60
|
-
}).then(response => {
|
|
61
|
-
let data = response.data;
|
|
62
|
-
// let visitMagicLink = data.result; //@Deprecated. Superseded by magic code usage.
|
|
63
|
-
const errorMessage = data.errorMessage;
|
|
64
|
-
const magicCode = data.magicCode;
|
|
65
|
-
const responseReferenceId = data.responseReferenceId;
|
|
66
|
-
let finalBaseUrl = '';
|
|
67
|
-
if (environment.toUpperCase() === 'PROD') {
|
|
68
|
-
finalBaseUrl = constants.PROD_BASE_URL;
|
|
69
|
-
} else {
|
|
70
|
-
finalBaseUrl = constants.STAGE_BASE_URL;
|
|
71
|
-
}
|
|
72
|
-
let finalUrl = `${finalBaseUrl}=${magicCode}`;
|
|
73
|
-
if (data.message === 'success') {
|
|
74
|
-
var _moduleName$trim;
|
|
75
|
-
if (((moduleName === null || moduleName === void 0 || (_moduleName$trim = moduleName.trim()) === null || _moduleName$trim === void 0 ? void 0 : _moduleName$trim.length) || 0) > 0) {
|
|
76
|
-
finalUrl += `&tab=${moduleName}`;
|
|
77
|
-
}
|
|
78
|
-
if (typeof responseReferenceId === 'string' && responseReferenceId.trim().length > 0) {
|
|
79
|
-
finalUrl += `&responseReferenceId=${responseReferenceId}`;
|
|
80
|
-
}
|
|
81
|
-
if (isLoggingEnabled) {
|
|
82
|
-
console.log('magicLink: ' + finalUrl);
|
|
83
|
-
}
|
|
84
|
-
setSource(finalUrl);
|
|
85
|
-
} else {
|
|
86
|
-
var errorUrl = `${errorBaseUrl}/star-health?error=${errorMessage}`;
|
|
87
|
-
setSource(errorUrl);
|
|
88
|
-
if (errorMessage != null) {
|
|
89
|
-
if (errorMessage === 'Please login again') {
|
|
90
|
-
EventRegister.emitEvent('visit-event', {
|
|
91
|
-
message: 'unauthorized-wellness-access',
|
|
92
|
-
errorMessage: errorMessage
|
|
93
|
-
});
|
|
94
|
-
} else if (errorMessage.includes('External Server Error')) {
|
|
95
|
-
EventRegister.emitEvent('visit-event', {
|
|
96
|
-
message: 'external-server-error',
|
|
97
|
-
errorMessage: errorMessage
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (isLoggingEnabled) {
|
|
102
|
-
console.log('erorMessage: ' + data.errorMessage + ' errorUrl: ' + errorUrl);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}).catch(error => {
|
|
106
|
-
var errorUrl = `${errorBaseUrl}/star-health?error=${error}`;
|
|
107
|
-
setSource(errorUrl);
|
|
108
|
-
EventRegister.emitEvent('visit-event', {
|
|
109
|
-
message: 'generate-magic-link-failed',
|
|
110
|
-
errorMessage: `${error}`
|
|
111
|
-
});
|
|
112
|
-
if (isLoggingEnabled) {
|
|
113
|
-
console.log('error: ' + error);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
}).catch(err => {
|
|
117
|
-
var errorUrl = `${errorBaseUrl}/star-health?error=${err}`;
|
|
118
|
-
setSource(errorUrl);
|
|
119
|
-
EventRegister.emitEvent('visit-event', {
|
|
120
|
-
message: 'getDeviceInfo-failed',
|
|
121
|
-
errorMessage: `${err}`
|
|
66
|
+
if (!uuid && !mobileNumber) {
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
EventRegister.emitEvent('mytatva-event', {
|
|
69
|
+
message: 'unique-identifier',
|
|
70
|
+
errorMessage: 'contact number or patientId is required'
|
|
122
71
|
});
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
72
|
+
}, 1000);
|
|
73
|
+
setError(true);
|
|
74
|
+
} else {
|
|
75
|
+
authenticateSDK();
|
|
76
|
+
setError(false);
|
|
127
77
|
}
|
|
128
|
-
}, [
|
|
78
|
+
}, [uuid, mobileNumber]);
|
|
129
79
|
useEffect(() => {
|
|
130
80
|
const subscription = AppState.addEventListener('change', handleAppStateChange);
|
|
131
81
|
console.log(`AppState.addEventListener added, current state: ${appState}`);
|
|
@@ -134,6 +84,39 @@ const MyTatvaRnSdkView = ({
|
|
|
134
84
|
};
|
|
135
85
|
}, [appState]); // Include appState in the dependency array to ensure it's up to date.
|
|
136
86
|
|
|
87
|
+
const authenticateSDK = () => {
|
|
88
|
+
setLoading(true);
|
|
89
|
+
let baseUrl = environment.toUpperCase() === 'PROD' ? constants.PROD_BASE_URL : constants.STAGE_BASE_URL;
|
|
90
|
+
const finalUrl = baseUrl + '/helper/authenticateClient';
|
|
91
|
+
const data = {
|
|
92
|
+
source: clientSource,
|
|
93
|
+
sourceKey: token
|
|
94
|
+
};
|
|
95
|
+
axios({
|
|
96
|
+
method: 'post',
|
|
97
|
+
url: finalUrl,
|
|
98
|
+
headers: {
|
|
99
|
+
'api-key': environment.toUpperCase() === 'PROD' ? constants.PROD_API_KEY : constants.STAGE_API_KEY,
|
|
100
|
+
'Content-Type': 'text/plain'
|
|
101
|
+
},
|
|
102
|
+
data: getEncryptedText(data, environment)
|
|
103
|
+
}).then(async response => {
|
|
104
|
+
const parsedResponse = await JSON.parse(getDecryptedData(response === null || response === void 0 ? void 0 : response.data, environment));
|
|
105
|
+
if ((parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.data) == 0) {
|
|
106
|
+
setError(true);
|
|
107
|
+
EventRegister.emitEvent('mytatva-event', {
|
|
108
|
+
message: 'unauthorized-client',
|
|
109
|
+
errorMessage: 'Unauthorized Access'
|
|
110
|
+
});
|
|
111
|
+
} else {
|
|
112
|
+
getSourceUrl();
|
|
113
|
+
}
|
|
114
|
+
}).catch(error => {
|
|
115
|
+
console.log("error", error);
|
|
116
|
+
}).finally(() => {
|
|
117
|
+
setLoading(false);
|
|
118
|
+
});
|
|
119
|
+
};
|
|
137
120
|
const handleAppStateChange = nextAppState => {
|
|
138
121
|
// console.log(
|
|
139
122
|
// "nextAppState: " + nextAppState + ", previousState: " + appState
|
|
@@ -144,227 +127,30 @@ const MyTatvaRnSdkView = ({
|
|
|
144
127
|
if (isLoggingEnabled) {
|
|
145
128
|
console.log('App has come to the foreground!');
|
|
146
129
|
}
|
|
147
|
-
getHealthConnectStatus();
|
|
130
|
+
// getHealthConnectStatus();
|
|
148
131
|
}
|
|
149
|
-
|
|
132
|
+
|
|
133
|
+
// setAppState(nextAppState); // Update the state with the new app state
|
|
150
134
|
};
|
|
151
|
-
const [enabled, requestResolution] = useLocationSettings({
|
|
152
|
-
priority: HIGH_ACCURACY,
|
|
153
|
-
// default BALANCED_POWER_ACCURACY
|
|
154
|
-
alwaysShow: true,
|
|
155
|
-
// default false
|
|
156
|
-
needBle: true // default false
|
|
157
|
-
}, false /* optional: default undefined */);
|
|
158
135
|
const webviewRef = useRef(null);
|
|
159
|
-
const showLocationPermissionAlert = () => {
|
|
160
|
-
Alert.alert('Permission Required', 'Allow location permission from app settings', [{
|
|
161
|
-
text: 'Cancel',
|
|
162
|
-
onPress: () => {
|
|
163
|
-
console.log('Cancel clicked');
|
|
164
|
-
}
|
|
165
|
-
}, {
|
|
166
|
-
text: 'Go to Settings',
|
|
167
|
-
onPress: () => {
|
|
168
|
-
Linking.openSettings();
|
|
169
|
-
}
|
|
170
|
-
}]);
|
|
171
|
-
};
|
|
172
|
-
const requestLocationPermission = async () => {
|
|
173
|
-
try {
|
|
174
|
-
console.log('requestLocationPermission called');
|
|
175
|
-
const isLocationPermissionPresent = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
|
|
176
|
-
console.log('isLocationPermissionPresent: ' + isLocationPermissionPresent + ' showPermissionAlreadyDeniedDialog: ' + showPermissionAlreadyDeniedDialog);
|
|
177
|
-
if (!isLocationPermissionPresent && showPermissionAlreadyDeniedDialog) {
|
|
178
|
-
console.log('showLocationPermissionAlert() called');
|
|
179
|
-
showLocationPermissionAlert();
|
|
180
|
-
} else {
|
|
181
|
-
console.log('requesting location permission');
|
|
182
|
-
const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, {
|
|
183
|
-
title: 'Need Location Permission',
|
|
184
|
-
message: 'Need access to location permission',
|
|
185
|
-
buttonNeutral: 'Ask Me Later',
|
|
186
|
-
buttonNegative: 'Cancel',
|
|
187
|
-
buttonPositive: 'OK'
|
|
188
|
-
});
|
|
189
|
-
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
|
190
|
-
if (isLoggingEnabled) {
|
|
191
|
-
console.log('Location permission granted');
|
|
192
|
-
}
|
|
193
|
-
setShowPermissionAlreadyDeniedDialog(false);
|
|
194
|
-
if (!enabled) {
|
|
195
|
-
requestResolution();
|
|
196
|
-
} else {
|
|
197
|
-
var _webviewRef$current;
|
|
198
|
-
var finalString = `window.checkTheGpsPermission(true)`;
|
|
199
|
-
console.log('requestLocationPermission: ' + finalString);
|
|
200
|
-
(_webviewRef$current = webviewRef.current) === null || _webviewRef$current === void 0 || _webviewRef$current.injectJavaScript(finalString);
|
|
201
|
-
}
|
|
202
|
-
} else {
|
|
203
|
-
setShowPermissionAlreadyDeniedDialog(true);
|
|
204
|
-
console.log('Location permission denied');
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
} catch (e) {
|
|
208
|
-
console.error(e);
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
const showHealthConnectPermissionDeniedDialog = () => {
|
|
212
|
-
Alert.alert('Permission Denied', 'Go to Health Connect App to allow app permission', [{
|
|
213
|
-
text: 'Cancel',
|
|
214
|
-
onPress: () => {
|
|
215
|
-
console.log('Cancel clicked');
|
|
216
|
-
}
|
|
217
|
-
}, {
|
|
218
|
-
text: 'Open Health Connect',
|
|
219
|
-
onPress: () => {
|
|
220
|
-
openHealthConnectApp();
|
|
221
|
-
}
|
|
222
|
-
}]);
|
|
223
|
-
};
|
|
224
|
-
const openHealthConnectApp = async () => {
|
|
225
|
-
NativeModules.VisitFitnessModule.openHealthConnectApp();
|
|
226
|
-
};
|
|
227
|
-
const askForHealthConnectPermission = async () => {
|
|
228
|
-
try {
|
|
229
|
-
const isPermissionGranted = await NativeModules.VisitFitnessModule.askForFitnessPermission();
|
|
230
|
-
if (isLoggingEnabled) {
|
|
231
|
-
console.log('isPermissionGranted: ' + isPermissionGranted);
|
|
232
|
-
}
|
|
233
|
-
if (isPermissionGranted === 'GRANTED') {
|
|
234
|
-
getHealthConnectStatus();
|
|
235
|
-
// getDailyFitnessData();
|
|
236
|
-
} else if (isPermissionGranted === 'CANCELLED') {
|
|
237
|
-
showHealthConnectPermissionDeniedDialog();
|
|
238
|
-
}
|
|
239
|
-
} catch (e) {
|
|
240
|
-
if (isLoggingEnabled) {
|
|
241
|
-
console.error(e);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
const getHealthConnectStatus = async () => {
|
|
246
|
-
try {
|
|
247
|
-
const healthConnectStatus = await NativeModules.VisitFitnessModule.getHealthConnectStatus();
|
|
248
|
-
if (isLoggingEnabled) {
|
|
249
|
-
console.log('getHealthConnectStatus: ' + healthConnectStatus);
|
|
250
|
-
}
|
|
251
|
-
if (healthConnectStatus === 'NOT_SUPPORTED') {
|
|
252
|
-
var _webviewRef$current2;
|
|
253
|
-
(_webviewRef$current2 = webviewRef.current) === null || _webviewRef$current2 === void 0 || _webviewRef$current2.injectJavaScript('window.healthConnectNotSupported()');
|
|
254
|
-
} else if (healthConnectStatus === 'NOT_INSTALLED') {
|
|
255
|
-
var _webviewRef$current3, _webviewRef$current4;
|
|
256
|
-
(_webviewRef$current3 = webviewRef.current) === null || _webviewRef$current3 === void 0 || _webviewRef$current3.injectJavaScript('window.healthConnectNotInstall()');
|
|
257
|
-
(_webviewRef$current4 = webviewRef.current) === null || _webviewRef$current4 === void 0 || _webviewRef$current4.injectJavaScript('window.updateFitnessPermissions(false,0,0)');
|
|
258
|
-
} else if (healthConnectStatus === 'INSTALLED') {
|
|
259
|
-
var _webviewRef$current5, _webviewRef$current6;
|
|
260
|
-
(_webviewRef$current5 = webviewRef.current) === null || _webviewRef$current5 === void 0 || _webviewRef$current5.injectJavaScript('window.healthConnectAvailable()');
|
|
261
|
-
(_webviewRef$current6 = webviewRef.current) === null || _webviewRef$current6 === void 0 || _webviewRef$current6.injectJavaScript('window.updateFitnessPermissions(false,0,0)');
|
|
262
|
-
} else if (healthConnectStatus === 'CONNECTED') {
|
|
263
|
-
getDailyFitnessData();
|
|
264
|
-
}
|
|
265
|
-
} catch (e) {
|
|
266
|
-
if (isLoggingEnabled) {
|
|
267
|
-
console.error(e);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
const getDailyFitnessData = async () => {
|
|
272
|
-
if (isLoggingEnabled) {
|
|
273
|
-
console.log('getDailyFitnessData() called');
|
|
274
|
-
}
|
|
275
|
-
try {
|
|
276
|
-
var _webviewRef$current7;
|
|
277
|
-
const dailyFitnessData = await NativeModules.VisitFitnessModule.requestDailyFitnessData();
|
|
278
|
-
(_webviewRef$current7 = webviewRef.current) === null || _webviewRef$current7 === void 0 || _webviewRef$current7.injectJavaScript(dailyFitnessData);
|
|
279
|
-
} catch (error) {
|
|
280
|
-
if (isLoggingEnabled) {
|
|
281
|
-
console.log(error);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
const requestActivityData = async (type, frequency, timeStamp) => {
|
|
286
|
-
if (isLoggingEnabled) {
|
|
287
|
-
console.log('requestActivityData() called');
|
|
288
|
-
}
|
|
289
|
-
try {
|
|
290
|
-
var _webviewRef$current8;
|
|
291
|
-
const graphData = await NativeModules.VisitFitnessModule.requestActivityDataFromHealthConnect(type, frequency, timeStamp);
|
|
292
|
-
if (isLoggingEnabled) {
|
|
293
|
-
console.log(`requestActivityData() data: ` + graphData);
|
|
294
|
-
}
|
|
295
|
-
(_webviewRef$current8 = webviewRef.current) === null || _webviewRef$current8 === void 0 || _webviewRef$current8.injectJavaScript('window.' + graphData);
|
|
296
|
-
} catch (error) {
|
|
297
|
-
if (isLoggingEnabled) {
|
|
298
|
-
console.log(error);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
const updateApiBaseUrl = async (apiBaseUrl, authtoken, googleFitLastSync, gfHourlyLastSync) => {
|
|
303
|
-
if (isLoggingEnabled) {
|
|
304
|
-
console.log('updateApiBaseUrl() called.');
|
|
305
|
-
}
|
|
306
|
-
try {
|
|
307
|
-
const message = await NativeModules.VisitFitnessModule.updateApiBaseUrl(apiBaseUrl, authtoken, googleFitLastSync, gfHourlyLastSync);
|
|
308
|
-
if (isLoggingEnabled) {
|
|
309
|
-
console.log(message);
|
|
310
|
-
}
|
|
311
|
-
} catch (error) {
|
|
312
|
-
if (isLoggingEnabled) {
|
|
313
|
-
console.log(error);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
136
|
const runBeforeFirst = `
|
|
318
137
|
window.isNativeApp = true;
|
|
319
138
|
window.platform = "ANDROID";
|
|
320
139
|
window.setSdkPlatform('ANDROID');
|
|
321
140
|
true; // note: this is required, or you'll sometimes get silent failures
|
|
322
141
|
`;
|
|
142
|
+
|
|
143
|
+
// console.log("runBeforeFirst====", runBeforeFirst)
|
|
323
144
|
const handleMessage = event => {
|
|
324
|
-
var _webviewRef$
|
|
145
|
+
var _webviewRef$current;
|
|
146
|
+
console.log("event====", event);
|
|
325
147
|
if (event.nativeEvent.data != null) {
|
|
326
148
|
try {
|
|
327
|
-
if (isLoggingEnabled) {
|
|
328
|
-
console.log('Event :' + event.nativeEvent.data);
|
|
329
|
-
}
|
|
330
149
|
const parsedObject = JSON.parse(event.nativeEvent.data);
|
|
331
150
|
if (parsedObject.method != null) {
|
|
332
151
|
switch (parsedObject.method) {
|
|
333
|
-
case 'GET_HEALTH_CONNECT_STATUS':
|
|
334
|
-
getHealthConnectStatus();
|
|
335
|
-
break;
|
|
336
|
-
case 'CONNECT_TO_GOOGLE_FIT':
|
|
337
|
-
askForHealthConnectPermission();
|
|
338
|
-
break;
|
|
339
152
|
case 'UPDATE_PLATFORM':
|
|
340
|
-
(_webviewRef$
|
|
341
|
-
break;
|
|
342
|
-
case 'UPDATE_API_BASE_URL':
|
|
343
|
-
{
|
|
344
|
-
let apiBaseUrl = parsedObject.apiBaseUrl;
|
|
345
|
-
let authtoken = parsedObject.authtoken;
|
|
346
|
-
let googleFitLastSync = parsedObject.googleFitLastSync;
|
|
347
|
-
let gfHourlyLastSync = parsedObject.gfHourlyLastSync;
|
|
348
|
-
if (isLoggingEnabled) {
|
|
349
|
-
console.log('apiBaseUrl: ' + 'NOT SHOWN' + ' authtoken: ' + 'NOT SHOWN' + ' googleFitLastSync: ' + googleFitLastSync + ' gfHourlyLastSync: ' + gfHourlyLastSync);
|
|
350
|
-
}
|
|
351
|
-
updateApiBaseUrl(apiBaseUrl, authtoken, googleFitLastSync, gfHourlyLastSync);
|
|
352
|
-
}
|
|
353
|
-
break;
|
|
354
|
-
case 'GET_DATA_TO_GENERATE_GRAPH':
|
|
355
|
-
{
|
|
356
|
-
let type = parsedObject.type;
|
|
357
|
-
let frequency = parsedObject.frequency;
|
|
358
|
-
let timeStamp = parsedObject.timestamp;
|
|
359
|
-
if (isLoggingEnabled) {
|
|
360
|
-
console.log('type: ' + type + ' frequency:' + frequency + ' timeStamp: ' + timeStamp);
|
|
361
|
-
}
|
|
362
|
-
requestActivityData(type, frequency, timeStamp);
|
|
363
|
-
}
|
|
364
|
-
break;
|
|
365
|
-
case 'GET_LOCATION_PERMISSIONS':
|
|
366
|
-
console.log('GET_LOCATION_PERMISSIONS');
|
|
367
|
-
requestLocationPermission();
|
|
153
|
+
(_webviewRef$current = webviewRef.current) === null || _webviewRef$current === void 0 || _webviewRef$current.injectJavaScript('window.setSdkPlatform("ANDROID")');
|
|
368
154
|
break;
|
|
369
155
|
case 'OPEN_PDF':
|
|
370
156
|
{
|
|
@@ -376,133 +162,99 @@ const MyTatvaRnSdkView = ({
|
|
|
376
162
|
break;
|
|
377
163
|
case 'CLOSE_VIEW':
|
|
378
164
|
break;
|
|
165
|
+
case 'OPEN_URL_HANDLER':
|
|
166
|
+
navigation.navigate('UrlHandler', {
|
|
167
|
+
url: parsedObject.url
|
|
168
|
+
});
|
|
169
|
+
break;
|
|
379
170
|
default:
|
|
380
171
|
break;
|
|
381
172
|
}
|
|
382
173
|
}
|
|
383
174
|
} catch (exception) {
|
|
384
|
-
console.log('Exception
|
|
175
|
+
console.log('Exception occurred:' + exception.message);
|
|
385
176
|
}
|
|
386
177
|
}
|
|
387
178
|
};
|
|
388
179
|
const [canGoBack, setCanGoBack] = useState(false);
|
|
389
180
|
const handleBack = useCallback(() => {
|
|
390
181
|
if (canGoBack && webviewRef.current) {
|
|
391
|
-
var _webviewRef$
|
|
392
|
-
(_webviewRef$
|
|
182
|
+
var _webviewRef$current2;
|
|
183
|
+
(_webviewRef$current2 = webviewRef.current) === null || _webviewRef$current2 === void 0 || _webviewRef$current2.goBack();
|
|
393
184
|
return true;
|
|
394
185
|
}
|
|
395
186
|
return false;
|
|
396
187
|
}, [canGoBack]);
|
|
397
188
|
useEffect(() => {
|
|
398
|
-
const gpsListener = addListener(({
|
|
399
|
-
locationEnabled
|
|
400
|
-
}) => {
|
|
401
|
-
if (locationEnabled) {
|
|
402
|
-
checkLocationPermissionAndSendCallback();
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
189
|
BackHandler.addEventListener('hardwareBackPress', handleBack);
|
|
406
190
|
return () => {
|
|
407
191
|
BackHandler.removeEventListener('hardwareBackPress', handleBack);
|
|
408
|
-
gpsListener.remove();
|
|
192
|
+
// gpsListener.remove();
|
|
409
193
|
};
|
|
410
194
|
}, [handleBack]);
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
195
|
+
const getSourceUrl = () => {
|
|
196
|
+
let finalUrl = '';
|
|
197
|
+
const params = {
|
|
198
|
+
uuid,
|
|
199
|
+
mobileNumber,
|
|
200
|
+
clientSource,
|
|
201
|
+
moduleName,
|
|
202
|
+
environment,
|
|
203
|
+
...userMetaInfo
|
|
204
|
+
};
|
|
205
|
+
let baseUrl = environment.toUpperCase() === 'PROD' ? constants.PROD_BASE_URL : constants.STAGE_BASE_URL;
|
|
206
|
+
if (baseUrl) {
|
|
207
|
+
finalUrl = baseUrl + '?data=' + encodeURIComponent(JSON.stringify(params));
|
|
208
|
+
setSource(finalUrl);
|
|
209
|
+
} else {
|
|
210
|
+
console.log("No baseUrl");
|
|
421
211
|
}
|
|
422
212
|
};
|
|
423
|
-
return (
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
style: {
|
|
428
|
-
flex: 1
|
|
429
|
-
}
|
|
430
|
-
}, source ? /*#__PURE__*/React.createElement(WebView, {
|
|
431
|
-
ref: webviewRef,
|
|
432
|
-
source: {
|
|
433
|
-
uri: source,
|
|
434
|
-
headers: {
|
|
435
|
-
platform: 'ANDROID'
|
|
436
|
-
}
|
|
437
|
-
},
|
|
438
|
-
onMessage: handleMessage,
|
|
439
|
-
injectedJavaScriptBeforeContentLoaded: runBeforeFirst,
|
|
440
|
-
javaScriptEnabled: true,
|
|
441
|
-
onLoadProgress: event => setCanGoBack(event.nativeEvent.canGoBack),
|
|
442
|
-
onError: errorMessage => {
|
|
443
|
-
EventRegister.emitEvent('visit-event', {
|
|
444
|
-
message: 'web-view-error',
|
|
445
|
-
errorMessage: errorMessage
|
|
446
|
-
});
|
|
447
|
-
if (isLoggingEnabled) {
|
|
448
|
-
console.warn('Webview error: ', errorMessage);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}) : null)
|
|
452
|
-
);
|
|
453
|
-
};
|
|
454
|
-
export const fetchDailyFitnessData = (startTimeStamp, isLoggingEnabled) => {
|
|
455
|
-
return new Promise((resolve, reject) => {
|
|
456
|
-
console.log('fetchDailyFitnessData called: ' + startTimeStamp);
|
|
457
|
-
NativeModules.VisitFitnessModule.fetchDailyFitnessData(startTimeStamp).then(result => {
|
|
458
|
-
resolve(result);
|
|
459
|
-
}).catch(err => reject(err));
|
|
460
|
-
});
|
|
461
|
-
};
|
|
462
|
-
export const fetchHourlyFitnessData = (startTimeStamp, isLoggingEnabled) => {
|
|
463
|
-
return new Promise((resolve, reject) => {
|
|
464
|
-
if (isLoggingEnabled) {
|
|
465
|
-
console.log('fetchHourlyFitnessData called: ' + startTimeStamp);
|
|
213
|
+
return /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
214
|
+
style: {
|
|
215
|
+
flex: 1,
|
|
216
|
+
backgroundColor: 'white'
|
|
466
217
|
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
218
|
+
}, /*#__PURE__*/React.createElement(Provider, {
|
|
219
|
+
store: store
|
|
220
|
+
}, /*#__PURE__*/React.createElement(SheetProvider, null, moduleName === 'progress' ? /*#__PURE__*/React.createElement(ProgressWebView, {
|
|
221
|
+
token: token,
|
|
222
|
+
environment: environment,
|
|
223
|
+
source: source,
|
|
224
|
+
loading: loading,
|
|
225
|
+
isError: isError,
|
|
226
|
+
webviewRef: webviewRef,
|
|
227
|
+
runBeforeFirst: runBeforeFirst,
|
|
228
|
+
setCanGoBack: setCanGoBack,
|
|
229
|
+
mobileNumber: mobileNumber,
|
|
230
|
+
moduleName: moduleName,
|
|
231
|
+
uuid: uuid,
|
|
232
|
+
clientSource: clientSource
|
|
233
|
+
}) : /*#__PURE__*/React.createElement(MainWebView, {
|
|
234
|
+
token: token,
|
|
235
|
+
environment: environment,
|
|
236
|
+
source: source,
|
|
237
|
+
loading: loading,
|
|
238
|
+
isError: isError,
|
|
239
|
+
webviewRef: webviewRef,
|
|
240
|
+
handleMessage: handleMessage,
|
|
241
|
+
runBeforeFirst: runBeforeFirst,
|
|
242
|
+
setCanGoBack: setCanGoBack,
|
|
243
|
+
clientSource: clientSource,
|
|
244
|
+
moduleName: moduleName
|
|
245
|
+
}))));
|
|
471
246
|
};
|
|
472
|
-
|
|
473
|
-
// debounce, deferred
|
|
474
|
-
// function debounce(task, ms) {
|
|
475
|
-
// let t = { promise: null, cancel: (_) => void 0 };
|
|
476
|
-
// return async (...args) => {
|
|
477
|
-
// try {
|
|
478
|
-
// t.cancel();
|
|
479
|
-
// t = deferred(ms);
|
|
480
|
-
// await t.promise;
|
|
481
|
-
// await task(...args);
|
|
482
|
-
// } catch (_) {
|
|
483
|
-
// console.log('cleaning up cancelled promise');
|
|
484
|
-
// }
|
|
485
|
-
// };
|
|
486
|
-
// }
|
|
487
|
-
|
|
488
|
-
// function deferred(ms) {
|
|
489
|
-
// let cancel,
|
|
490
|
-
// promise = new Promise((resolve, reject) => {
|
|
491
|
-
// cancel = reject;
|
|
492
|
-
// setTimeout(resolve, ms);
|
|
493
|
-
// });
|
|
494
|
-
// return { promise, cancel };
|
|
495
|
-
// }
|
|
496
|
-
|
|
497
247
|
export default MyTatvaRnSdkView;
|
|
498
248
|
MyTatvaRnSdkView.defaultProps = {
|
|
499
|
-
|
|
249
|
+
mobileNumber: '',
|
|
250
|
+
uuid: '',
|
|
500
251
|
token: '',
|
|
501
252
|
baseUrl: '',
|
|
502
253
|
errorBaseUrl: '',
|
|
503
|
-
moduleName: '',
|
|
504
254
|
environment: '',
|
|
505
|
-
|
|
506
|
-
|
|
255
|
+
metaInfo: {},
|
|
256
|
+
clientSource: '',
|
|
257
|
+
moduleName: '',
|
|
258
|
+
navigation: {}
|
|
507
259
|
};
|
|
508
260
|
//# sourceMappingURL=index.android.js.map
|