react-native-visit-rn-sdk 6.0.1 → 6.0.2
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/README.md +49 -1
- package/android/src/main/java/com/visitrnsdk/VisitRnSdkLocationModule.kt +37 -0
- package/android/src/main/java/com/visitrnsdk/VisitRnSdkPackage.kt +1 -1
- package/lib/commonjs/index.android.js +140 -139
- package/lib/commonjs/index.android.js.map +1 -1
- package/lib/commonjs/index.ios.js +4 -14
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/module/index.android.js +141 -141
- package/lib/module/index.android.js.map +1 -1
- package/lib/module/index.ios.js +4 -14
- package/lib/module/index.ios.js.map +1 -1
- package/lib/typescript/components/VideoCallComponent.d.ts +4 -0
- package/lib/typescript/components/VideoCallComponent.d.ts.map +1 -0
- package/lib/typescript/index.android.d.ts +13 -0
- package/lib/typescript/index.android.d.ts.map +1 -0
- package/lib/typescript/index.ios.d.ts +13 -0
- package/lib/typescript/index.ios.d.ts.map +1 -0
- package/package.json +10 -5
- package/react-native-visit-rn-sdk.podspec +1 -1
- package/src/index.android.js +186 -166
- package/src/index.ios.js +4 -15
- package/lib/typescript/index.test.d.ts +0 -1
- package/lib/typescript/index.test.d.ts.map +0 -1
|
@@ -1,87 +1,146 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useState, useCallback } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Alert, AppState, BackHandler, Linking, NativeModules, SafeAreaView } from 'react-native';
|
|
3
|
+
import { check, openSettings, PERMISSIONS, request, RESULTS } from 'react-native-permissions';
|
|
4
4
|
import WebView from 'react-native-webview';
|
|
5
|
-
import LocationEnabler from '@visit-health/react-native-location-enabler';
|
|
6
5
|
import VideoCallComponent from './components/VideoCallComponent';
|
|
6
|
+
const LOCATION_SOURCE_SETTINGS = 'android.settings.LOCATION_SOURCE_SETTINGS';
|
|
7
|
+
const GENERAL_SETTINGS = 'android.settings.SETTINGS';
|
|
7
8
|
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
useLocationSettings,
|
|
12
|
-
addListener
|
|
13
|
-
} = LocationEnabler;
|
|
9
|
+
VisitRnSdkLocation
|
|
10
|
+
} = NativeModules;
|
|
14
11
|
const VisitRnSdkView = ({
|
|
15
12
|
ssoLink,
|
|
16
13
|
isLoggingEnabled
|
|
17
14
|
}) => {
|
|
18
15
|
const source = typeof ssoLink === 'string' ? ssoLink.trim() : '';
|
|
19
|
-
const [showPermissionAlreadyDeniedDialog, setShowPermissionAlreadyDeniedDialog] = useState(false);
|
|
20
|
-
const [enabled, requestResolution] = useLocationSettings({
|
|
21
|
-
priority: HIGH_ACCURACY,
|
|
22
|
-
// default BALANCED_POWER_ACCURACY
|
|
23
|
-
alwaysShow: true,
|
|
24
|
-
// default false
|
|
25
|
-
needBle: true // default false
|
|
26
|
-
}, false /* optional: default undefined */);
|
|
27
16
|
const webviewRef = useRef(null);
|
|
28
17
|
const videoCallRef = useRef(null);
|
|
29
|
-
const
|
|
30
|
-
|
|
18
|
+
const locationFlowInProgressRef = useRef(false);
|
|
19
|
+
const pendingSettingsRef = useRef(null);
|
|
20
|
+
const appStateRef = useRef(AppState.currentState);
|
|
21
|
+
const [canGoBack, setCanGoBack] = useState(false);
|
|
22
|
+
const warn = useCallback((message, error) => {
|
|
23
|
+
if (isLoggingEnabled) {
|
|
24
|
+
console.warn(message, error);
|
|
25
|
+
}
|
|
26
|
+
}, [isLoggingEnabled]);
|
|
27
|
+
const finishLocationFlow = useCallback(granted => {
|
|
28
|
+
var _webviewRef$current;
|
|
29
|
+
locationFlowInProgressRef.current = false;
|
|
30
|
+
pendingSettingsRef.current = null;
|
|
31
|
+
(_webviewRef$current = webviewRef.current) === null || _webviewRef$current === void 0 || _webviewRef$current.injectJavaScript(`window.checkTheGpsPermission(${granted}); true;`);
|
|
32
|
+
}, []);
|
|
33
|
+
const showLocationPermissionSettingsAlert = useCallback(() => {
|
|
34
|
+
Alert.alert('Location permission required', 'Allow location access in app settings to continue.', [{
|
|
31
35
|
text: 'Cancel',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
36
|
+
style: 'cancel',
|
|
37
|
+
onPress: () => finishLocationFlow(false)
|
|
35
38
|
}, {
|
|
36
|
-
text: '
|
|
37
|
-
onPress: () => {
|
|
38
|
-
|
|
39
|
+
text: 'Open Settings',
|
|
40
|
+
onPress: async () => {
|
|
41
|
+
pendingSettingsRef.current = 'location-permission';
|
|
42
|
+
try {
|
|
43
|
+
await openSettings();
|
|
44
|
+
} catch (error) {
|
|
45
|
+
warn('Unable to open application settings.', error);
|
|
46
|
+
finishLocationFlow(false);
|
|
47
|
+
}
|
|
39
48
|
}
|
|
40
|
-
}]
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
}], {
|
|
50
|
+
cancelable: false
|
|
51
|
+
});
|
|
52
|
+
}, [finishLocationFlow, warn]);
|
|
53
|
+
const openLocationServicesSettings = useCallback(async () => {
|
|
54
|
+
pendingSettingsRef.current = 'location-services';
|
|
43
55
|
try {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
await Linking.sendIntent(LOCATION_SOURCE_SETTINGS);
|
|
57
|
+
} catch (locationSettingsError) {
|
|
58
|
+
warn('Unable to open Location Services settings; opening general settings.', locationSettingsError);
|
|
59
|
+
try {
|
|
60
|
+
await Linking.sendIntent(GENERAL_SETTINGS);
|
|
61
|
+
} catch (generalSettingsError) {
|
|
62
|
+
warn('Unable to open Android settings.', generalSettingsError);
|
|
63
|
+
finishLocationFlow(false);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, [finishLocationFlow, warn]);
|
|
67
|
+
const checkLocationServices = useCallback(async ({
|
|
68
|
+
promptIfDisabled
|
|
69
|
+
}) => {
|
|
70
|
+
try {
|
|
71
|
+
if (!(VisitRnSdkLocation !== null && VisitRnSdkLocation !== void 0 && VisitRnSdkLocation.isLocationServicesEnabled)) {
|
|
72
|
+
throw new Error('VisitRnSdkLocation native module is unavailable.');
|
|
73
|
+
}
|
|
74
|
+
const isEnabled = await VisitRnSdkLocation.isLocationServicesEnabled();
|
|
75
|
+
if (isEnabled) {
|
|
76
|
+
finishLocationFlow(true);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (!promptIfDisabled) {
|
|
80
|
+
finishLocationFlow(false);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
Alert.alert('Turn on Location Services', 'Enable Location Services in phone settings to continue.', [{
|
|
84
|
+
text: 'Cancel',
|
|
85
|
+
style: 'cancel',
|
|
86
|
+
onPress: () => finishLocationFlow(false)
|
|
87
|
+
}, {
|
|
88
|
+
text: 'Open Settings',
|
|
89
|
+
onPress: openLocationServicesSettings
|
|
90
|
+
}], {
|
|
91
|
+
cancelable: false
|
|
92
|
+
});
|
|
93
|
+
} catch (error) {
|
|
94
|
+
warn('Unable to check Location Services.', error);
|
|
95
|
+
finishLocationFlow(false);
|
|
96
|
+
}
|
|
97
|
+
}, [finishLocationFlow, openLocationServicesSettings, warn]);
|
|
98
|
+
const requestLocationPermission = useCallback(async () => {
|
|
99
|
+
if (locationFlowInProgressRef.current || pendingSettingsRef.current !== null) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
locationFlowInProgressRef.current = true;
|
|
103
|
+
try {
|
|
104
|
+
let permissionStatus = await check(PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION);
|
|
105
|
+
if (permissionStatus === RESULTS.DENIED) {
|
|
106
|
+
permissionStatus = await request(PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION);
|
|
107
|
+
}
|
|
108
|
+
if (permissionStatus === RESULTS.GRANTED) {
|
|
109
|
+
await checkLocationServices({
|
|
110
|
+
promptIfDisabled: true
|
|
58
111
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (!enabled) {
|
|
65
|
-
requestResolution();
|
|
66
|
-
} else {
|
|
67
|
-
var _webviewRef$current;
|
|
68
|
-
var finalString = `window.checkTheGpsPermission(true)`;
|
|
69
|
-
console.log('requestLocationPermission: ' + finalString);
|
|
70
|
-
(_webviewRef$current = webviewRef.current) === null || _webviewRef$current === void 0 || _webviewRef$current.injectJavaScript(finalString);
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
var _webviewRef$current2;
|
|
74
|
-
setShowPermissionAlreadyDeniedDialog(true);
|
|
75
|
-
console.log('Location permission denied');
|
|
76
|
-
var finalString = `window.checkTheGpsPermission(false)`;
|
|
77
|
-
console.log('requestLocationPermission: ' + finalString);
|
|
78
|
-
(_webviewRef$current2 = webviewRef.current) === null || _webviewRef$current2 === void 0 || _webviewRef$current2.injectJavaScript(finalString);
|
|
79
|
-
}
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (permissionStatus === RESULTS.BLOCKED) {
|
|
115
|
+
showLocationPermissionSettingsAlert();
|
|
116
|
+
return;
|
|
80
117
|
}
|
|
81
|
-
|
|
82
|
-
|
|
118
|
+
finishLocationFlow(false);
|
|
119
|
+
} catch (error) {
|
|
120
|
+
warn('Unable to check or request location permission.', error);
|
|
121
|
+
finishLocationFlow(false);
|
|
83
122
|
}
|
|
84
|
-
};
|
|
123
|
+
}, [checkLocationServices, finishLocationFlow, showLocationPermissionSettingsAlert, warn]);
|
|
124
|
+
const recheckAfterSettings = useCallback(async () => {
|
|
125
|
+
const settingsType = pendingSettingsRef.current;
|
|
126
|
+
if (!settingsType) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
pendingSettingsRef.current = null;
|
|
130
|
+
try {
|
|
131
|
+
const permissionStatus = await check(PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION);
|
|
132
|
+
if (permissionStatus !== RESULTS.GRANTED) {
|
|
133
|
+
finishLocationFlow(false);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
await checkLocationServices({
|
|
137
|
+
promptIfDisabled: settingsType === 'location-permission'
|
|
138
|
+
});
|
|
139
|
+
} catch (error) {
|
|
140
|
+
warn('Unable to recheck location access after settings.', error);
|
|
141
|
+
finishLocationFlow(false);
|
|
142
|
+
}
|
|
143
|
+
}, [checkLocationServices, finishLocationFlow, warn]);
|
|
85
144
|
const runBeforeFirst = `
|
|
86
145
|
window.isNativeApp = true;
|
|
87
146
|
window.platform = "ANDROID";
|
|
@@ -110,37 +169,26 @@ const VisitRnSdkView = ({
|
|
|
110
169
|
});
|
|
111
170
|
}, [isLoggingEnabled]);
|
|
112
171
|
const handleMessage = event => {
|
|
113
|
-
var _webviewRef$
|
|
172
|
+
var _webviewRef$current2;
|
|
114
173
|
if (event.nativeEvent.data != null) {
|
|
115
174
|
try {
|
|
175
|
+
const parsedObject = JSON.parse(event.nativeEvent.data);
|
|
116
176
|
if (isLoggingEnabled) {
|
|
117
|
-
console.log('
|
|
177
|
+
console.log('Received WebView method:', parsedObject.method);
|
|
118
178
|
}
|
|
119
|
-
const parsedObject = JSON.parse(event.nativeEvent.data);
|
|
120
179
|
if (parsedObject.method != null) {
|
|
121
180
|
switch (parsedObject.method) {
|
|
122
181
|
case 'startVideoCall':
|
|
123
182
|
startVideoConsultation(parsedObject);
|
|
124
183
|
break;
|
|
125
184
|
case 'UPDATE_PLATFORM':
|
|
126
|
-
(_webviewRef$
|
|
185
|
+
(_webviewRef$current2 = webviewRef.current) === null || _webviewRef$current2 === void 0 || _webviewRef$current2.injectJavaScript('window.setSdkPlatform("ANDROID")');
|
|
127
186
|
break;
|
|
128
187
|
case 'GET_LOCATION_PERMISSIONS':
|
|
129
|
-
console.log('GET_LOCATION_PERMISSIONS');
|
|
130
188
|
requestLocationPermission();
|
|
131
189
|
break;
|
|
132
190
|
case 'OPEN_PDF':
|
|
133
|
-
|
|
134
|
-
let pdfUrl = parsedObject.url;
|
|
135
|
-
// console.log("pdfUrl "+pdfUrl);
|
|
136
|
-
|
|
137
|
-
Linking.openURL(pdfUrl);
|
|
138
|
-
}
|
|
139
|
-
break;
|
|
140
|
-
case 'OPEN_FACE_SCAN_FLOW':
|
|
141
|
-
EventRegister.emitEvent('visit-event', {
|
|
142
|
-
message: 'OPEN_FACE_SCAN_FLOW'
|
|
143
|
-
});
|
|
191
|
+
Linking.openURL(parsedObject.url);
|
|
144
192
|
break;
|
|
145
193
|
case 'CLOSE_VIEW':
|
|
146
194
|
break;
|
|
@@ -148,51 +196,32 @@ const VisitRnSdkView = ({
|
|
|
148
196
|
break;
|
|
149
197
|
}
|
|
150
198
|
}
|
|
151
|
-
} catch (
|
|
152
|
-
|
|
199
|
+
} catch (error) {
|
|
200
|
+
warn('Unable to handle WebView message.', error);
|
|
153
201
|
}
|
|
154
202
|
}
|
|
155
203
|
};
|
|
156
|
-
const [canGoBack, setCanGoBack] = useState(false);
|
|
157
204
|
const handleBack = useCallback(() => {
|
|
158
205
|
if (canGoBack && webviewRef.current) {
|
|
159
|
-
|
|
160
|
-
(_webviewRef$current4 = webviewRef.current) === null || _webviewRef$current4 === void 0 || _webviewRef$current4.goBack();
|
|
206
|
+
webviewRef.current.goBack();
|
|
161
207
|
return true;
|
|
162
208
|
}
|
|
163
209
|
return false;
|
|
164
210
|
}, [canGoBack]);
|
|
165
|
-
const checkLocationPermissionAndSendCallback = useCallback(async () => {
|
|
166
|
-
const isLocationPermissionAvailable = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
|
|
167
|
-
if (isLoggingEnabled) {
|
|
168
|
-
console.log('checkLocationPermissionAndSendCallback() isLocationPermissionAvailable: ' + isLocationPermissionAvailable + 'isGPSPermissionAvailabe: true');
|
|
169
|
-
}
|
|
170
|
-
if (isLocationPermissionAvailable) {
|
|
171
|
-
var _webviewRef$current5;
|
|
172
|
-
var finalString = `window.checkTheGpsPermission(true)`;
|
|
173
|
-
console.log('listener: ' + finalString);
|
|
174
|
-
(_webviewRef$current5 = webviewRef.current) === null || _webviewRef$current5 === void 0 || _webviewRef$current5.injectJavaScript(finalString);
|
|
175
|
-
}
|
|
176
|
-
}, [isLoggingEnabled]);
|
|
177
211
|
useEffect(() => {
|
|
178
|
-
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
if (
|
|
183
|
-
|
|
212
|
+
const backSub = BackHandler.addEventListener('hardwareBackPress', handleBack);
|
|
213
|
+
const appStateSub = AppState.addEventListener('change', nextAppState => {
|
|
214
|
+
const wasInBackground = /inactive|background/.test(appStateRef.current);
|
|
215
|
+
appStateRef.current = nextAppState;
|
|
216
|
+
if (wasInBackground && nextAppState === 'active' && pendingSettingsRef.current) {
|
|
217
|
+
recheckAfterSettings();
|
|
184
218
|
}
|
|
185
219
|
});
|
|
186
|
-
|
|
187
|
-
// Subscribe to Android hardware back press
|
|
188
|
-
const backSub = BackHandler.addEventListener('hardwareBackPress', handleBack);
|
|
189
|
-
|
|
190
|
-
// Cleanup subscriptions on unmount
|
|
191
220
|
return () => {
|
|
192
221
|
backSub === null || backSub === void 0 || backSub.remove();
|
|
193
|
-
|
|
222
|
+
appStateSub === null || appStateSub === void 0 || appStateSub.remove();
|
|
194
223
|
};
|
|
195
|
-
}, [handleBack,
|
|
224
|
+
}, [handleBack, recheckAfterSettings]);
|
|
196
225
|
return (
|
|
197
226
|
/*#__PURE__*/
|
|
198
227
|
// eslint-disable-next-line react-native/no-inline-styles
|
|
@@ -213,10 +242,6 @@ const VisitRnSdkView = ({
|
|
|
213
242
|
javaScriptEnabled: true,
|
|
214
243
|
onLoadProgress: event => setCanGoBack(event.nativeEvent.canGoBack),
|
|
215
244
|
onError: errorMessage => {
|
|
216
|
-
EventRegister.emitEvent('visit-event', {
|
|
217
|
-
message: 'web-view-error',
|
|
218
|
-
errorMessage: errorMessage
|
|
219
|
-
});
|
|
220
245
|
if (isLoggingEnabled) {
|
|
221
246
|
console.warn('Webview error: ', errorMessage);
|
|
222
247
|
}
|
|
@@ -241,31 +266,6 @@ const VisitRnSdkView = ({
|
|
|
241
266
|
}))
|
|
242
267
|
);
|
|
243
268
|
};
|
|
244
|
-
|
|
245
|
-
// debounce, deferred
|
|
246
|
-
// function debounce(task, ms) {
|
|
247
|
-
// let t = { promise: null, cancel: (_) => void 0 };
|
|
248
|
-
// return async (...args) => {
|
|
249
|
-
// try {
|
|
250
|
-
// t.cancel();
|
|
251
|
-
// t = deferred(ms);
|
|
252
|
-
// await t.promise;
|
|
253
|
-
// await task(...args);
|
|
254
|
-
// } catch (_) {
|
|
255
|
-
// console.log('cleaning up cancelled promise');
|
|
256
|
-
// }
|
|
257
|
-
// };
|
|
258
|
-
// }
|
|
259
|
-
|
|
260
|
-
// function deferred(ms) {
|
|
261
|
-
// let cancel,
|
|
262
|
-
// promise = new Promise((resolve, reject) => {
|
|
263
|
-
// cancel = reject;
|
|
264
|
-
// setTimeout(resolve, ms);
|
|
265
|
-
// });
|
|
266
|
-
// return { promise, cancel };
|
|
267
|
-
// }
|
|
268
|
-
|
|
269
269
|
export default VisitRnSdkView;
|
|
270
270
|
VisitRnSdkView.defaultProps = {
|
|
271
271
|
ssoLink: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRef","useEffect","useState","useCallback","
|
|
1
|
+
{"version":3,"names":["React","useRef","useEffect","useState","useCallback","Alert","AppState","BackHandler","Linking","NativeModules","SafeAreaView","check","openSettings","PERMISSIONS","request","RESULTS","WebView","VideoCallComponent","LOCATION_SOURCE_SETTINGS","GENERAL_SETTINGS","VisitRnSdkLocation","VisitRnSdkView","ssoLink","isLoggingEnabled","source","trim","webviewRef","videoCallRef","locationFlowInProgressRef","pendingSettingsRef","appStateRef","currentState","canGoBack","setCanGoBack","warn","message","error","console","finishLocationFlow","granted","_webviewRef$current","current","injectJavaScript","showLocationPermissionSettingsAlert","alert","text","style","onPress","cancelable","openLocationServicesSettings","sendIntent","locationSettingsError","generalSettingsError","checkLocationServices","promptIfDisabled","isLocationServicesEnabled","Error","isEnabled","requestLocationPermission","permissionStatus","ANDROID","ACCESS_FINE_LOCATION","DENIED","GRANTED","BLOCKED","recheckAfterSettings","settingsType","runBeforeFirst","startVideoConsultation","parsedObject","_videoCallRef$current","roomName","accessToken","token","rawDoctorName","doctorName","visibleDoctorName","indexOf","replace","userName","startVideoCall","handleMessage","event","_webviewRef$current2","nativeEvent","data","JSON","parse","log","method","openURL","url","handleBack","goBack","backSub","addEventListener","appStateSub","nextAppState","wasInBackground","test","remove","createElement","flex","ref","uri","headers","platform","onMessage","injectedJavaScriptBeforeContentLoaded","javaScriptEnabled","onLoadProgress","onError","errorMessage","onCallConnected","info","onCallEnded","defaultProps"],"sourceRoot":"../../src","sources":["index.android.js"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AACvE,SACEC,KAAK,EACLC,QAAQ,EACRC,WAAW,EACXC,OAAO,EACPC,aAAa,EACbC,YAAY,QACP,cAAc;AACrB,SACEC,KAAK,EACLC,YAAY,EACZC,WAAW,EACXC,OAAO,EACPC,OAAO,QACF,0BAA0B;AACjC,OAAOC,OAAO,MAAM,sBAAsB;AAE1C,OAAOC,kBAAkB,MAAM,iCAAiC;AAEhE,MAAMC,wBAAwB,GAAG,2CAA2C;AAC5E,MAAMC,gBAAgB,GAAG,2BAA2B;AACpD,MAAM;EAAEC;AAAmB,CAAC,GAAGX,aAAa;AAE5C,MAAMY,cAAc,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAAiB,CAAC,KAAK;EACxD,MAAMC,MAAM,GAAG,OAAOF,OAAO,KAAK,QAAQ,GAAGA,OAAO,CAACG,IAAI,CAAC,CAAC,GAAG,EAAE;EAChE,MAAMC,UAAU,GAAGzB,MAAM,CAAC,IAAI,CAAC;EAC/B,MAAM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,EAAE;EACXC,gBAAgB,EAAE;AACpB,CAAC","ignoreList":[]}
|
package/lib/module/index.ios.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useCallback } from 'react';
|
|
2
2
|
import { StyleSheet, SafeAreaView, Linking, Dimensions } from 'react-native';
|
|
3
|
-
import { EventRegister } from 'react-native-event-listeners';
|
|
4
3
|
import { WebView } from 'react-native-webview';
|
|
5
4
|
import VideoCallComponent from './components/VideoCallComponent';
|
|
6
5
|
const escapeChars = {
|
|
@@ -25,7 +24,6 @@ str.replace(/\&([^;]+);/g, (entity, entityCode) => {
|
|
|
25
24
|
return entity;
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
|
-
const visitEvent = 'visit-event';
|
|
29
27
|
const VisitRnSdkView = ({
|
|
30
28
|
ssoLink,
|
|
31
29
|
isLoggingEnabled
|
|
@@ -60,15 +58,16 @@ const VisitRnSdkView = ({
|
|
|
60
58
|
userName
|
|
61
59
|
});
|
|
62
60
|
}, [isLoggingEnabled]);
|
|
63
|
-
const handleMessage =
|
|
61
|
+
const handleMessage = event => {
|
|
64
62
|
var _webviewRef$current, _webviewRef$current2;
|
|
65
63
|
const data = JSON.parse(unescapeHTML(event.nativeEvent.data));
|
|
66
64
|
const {
|
|
67
65
|
method,
|
|
68
66
|
url
|
|
69
67
|
} = data;
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
if (isLoggingEnabled) {
|
|
69
|
+
console.log('Received WebView method:', method);
|
|
70
|
+
}
|
|
72
71
|
switch (method) {
|
|
73
72
|
case 'startVideoCall':
|
|
74
73
|
startVideoConsultation(data);
|
|
@@ -79,11 +78,6 @@ const VisitRnSdkView = ({
|
|
|
79
78
|
case 'OPEN_PDF':
|
|
80
79
|
Linking.openURL(url);
|
|
81
80
|
break;
|
|
82
|
-
case 'OPEN_FACE_SCAN_FLOW':
|
|
83
|
-
EventRegister.emitEvent('visit-event', {
|
|
84
|
-
message: 'OPEN_FACE_SCAN_FLOW'
|
|
85
|
-
});
|
|
86
|
-
break;
|
|
87
81
|
case 'CLOSE_VIEW':
|
|
88
82
|
break;
|
|
89
83
|
case 'GET_LOCATION_PERMISSIONS':
|
|
@@ -117,10 +111,6 @@ const VisitRnSdkView = ({
|
|
|
117
111
|
onMessage: handleMessage,
|
|
118
112
|
injectedJavaScriptBeforeContentLoaded: runBeforeFirst,
|
|
119
113
|
onError: errorMessage => {
|
|
120
|
-
EventRegister.emitEvent(visitEvent, {
|
|
121
|
-
message: 'web-view-error',
|
|
122
|
-
errorMessage: errorMessage
|
|
123
|
-
});
|
|
124
114
|
if (isLoggingEnabled) {
|
|
125
115
|
console.warn('Webview error: ', errorMessage);
|
|
126
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRef","useCallback","StyleSheet","SafeAreaView","Linking","Dimensions","
|
|
1
|
+
{"version":3,"names":["React","useRef","useCallback","StyleSheet","SafeAreaView","Linking","Dimensions","WebView","VideoCallComponent","escapeChars","lt","gt","quot","apos","amp","unescapeHTML","str","replace","entity","entityCode","match","String","fromCharCode","parseInt","VisitRnSdkView","ssoLink","isLoggingEnabled","source","trim","webviewRef","videoCallRef","runBeforeFirst","startVideoConsultation","payload","_videoCallRef$current","roomName","accessToken","token","rawDoctorName","doctorName","visibleDoctorName","indexOf","userName","console","warn","current","startVideoCall","handleMessage","event","_webviewRef$current","_webviewRef$current2","data","JSON","parse","nativeEvent","method","url","log","injectJavaScript","openURL","height","width","get","createElement","style","flex","backgroundColor","ref","uri","styles","webView","javascriptEnabled","onMessage","injectedJavaScriptBeforeContentLoaded","onError","errorMessage","onCallConnected","info","onCallEnded","error","create","defaultProps"],"sourceRoot":"../../src","sources":["index.ios.js"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,WAAW,QAAQ,OAAO;AAClD,SAASC,UAAU,EAAEC,YAAY,EAAEC,OAAO,EAAEC,UAAU,QAAQ,cAAc;AAC5E,SAASC,OAAO,QAAQ,s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,IAAI,eACR3E,KAAA,CAAA+D,aAAA,CAACvD,kBAAkB;MACjB2D,GAAG,EAAErC,YAAa;MAClB8C,eAAe,EAAGC,IAAI,IAAK;QACzB,IAAInD,gBAAgB,EAAE;UACpBiB,OAAO,CAACc,GAAG,CAAC,uBAAuB,EAAEoB,IAAI,CAAC;QAC5C;MACF,CAAE;MACFC,WAAW,EAAGD,IAAI,IAAK;QACrB,IAAInD,gBAAgB,EAAE;UACpBiB,OAAO,CAACc,GAAG,CAAC,mBAAmB,EAAEoB,IAAI,CAAC;QACxC;MACF,CAAE;MACFH,OAAO,EAAGK,KAAK,IAAK;QAClB,IAAIrD,gBAAgB,EAAE;UACpBiB,OAAO,CAACoC,KAAK,CAAC,mBAAmB,EAAEA,KAAK,CAAC;QAC3C;MACF;IAAE,CACH,CACW;EAAC;AAEnB,CAAC;AAED,MAAMV,MAAM,GAAGlE,UAAU,CAAC6E,MAAM,CAAC;EAC/BV,OAAO,EAAE;IACPL,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEFzC,cAAc,CAACyD,YAAY,GAAG;EAC5BxD,OAAO,EAAE,EAAE;EACXC,gBAAgB,EAAE;AACpB,CAAC;AAED,eAAeF,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoCallComponent.d.ts","sourceRoot":"","sources":["../../../src/components/VideoCallComponent.js"],"names":[],"mappings":";AAkFA,4FA6yBE;kBAx3BK,OAAO"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default VisitRnSdkView;
|
|
2
|
+
declare function VisitRnSdkView({ ssoLink, isLoggingEnabled }: {
|
|
3
|
+
ssoLink: any;
|
|
4
|
+
isLoggingEnabled: any;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
declare namespace VisitRnSdkView {
|
|
7
|
+
namespace defaultProps {
|
|
8
|
+
let ssoLink: string;
|
|
9
|
+
let isLoggingEnabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
import React from 'react';
|
|
13
|
+
//# sourceMappingURL=index.android.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.android.d.ts","sourceRoot":"","sources":["../../src/index.android.js"],"names":[],"mappings":";AAwBA;;;sBA0UC;;;;;;;kBAlW+D,OAAO"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default VisitRnSdkView;
|
|
2
|
+
declare function VisitRnSdkView({ ssoLink, isLoggingEnabled }: {
|
|
3
|
+
ssoLink: any;
|
|
4
|
+
isLoggingEnabled: any;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
declare namespace VisitRnSdkView {
|
|
7
|
+
namespace defaultProps {
|
|
8
|
+
let ssoLink: string;
|
|
9
|
+
let isLoggingEnabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
import React from 'react';
|
|
13
|
+
//# sourceMappingURL=index.ios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../src/index.ios.js"],"names":[],"mappings":";AA8BA;;;sBAiHC;;;;;;;kBA/I0C,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-visit-rn-sdk",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "a package to inject data into visit health pwa",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"release": "release-it",
|
|
36
36
|
"example": "yarn --cwd example",
|
|
37
37
|
"build:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
|
|
38
|
-
"build:ios": "cd example/ios && xcodebuild -workspace
|
|
38
|
+
"build:ios": "cd example/ios && xcodebuild -workspace example.xcworkspace -scheme example -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
|
|
39
39
|
"bootstrap": "yarn example && yarn install && yarn example pods",
|
|
40
40
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
|
|
41
41
|
},
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"del-cli": "^5.0.0",
|
|
70
70
|
"eslint": "^8.4.1",
|
|
71
71
|
"eslint-config-prettier": "^8.5.0",
|
|
72
|
+
"eslint-plugin-jest": "^26.5.3",
|
|
72
73
|
"eslint-plugin-prettier": "^4.0.0",
|
|
73
74
|
"jest": "^28.1.1",
|
|
74
75
|
"pod-install": "^0.1.0",
|
|
@@ -76,6 +77,8 @@
|
|
|
76
77
|
"react": "18.2.0",
|
|
77
78
|
"react-native": "0.72.4",
|
|
78
79
|
"react-native-builder-bob": "^0.20.0",
|
|
80
|
+
"react-native-permissions": "4.1.5",
|
|
81
|
+
"react-test-renderer": "18.2.0",
|
|
79
82
|
"release-it": "^15.0.0",
|
|
80
83
|
"turbo": "^1.10.7",
|
|
81
84
|
"typescript": "^5.0.2"
|
|
@@ -86,7 +89,8 @@
|
|
|
86
89
|
"peerDependencies": {
|
|
87
90
|
"@twilio/video-react-native-sdk": "3.5.0",
|
|
88
91
|
"react": "*",
|
|
89
|
-
"react-native": "*"
|
|
92
|
+
"react-native": "*",
|
|
93
|
+
"react-native-permissions": "^4.1.5"
|
|
90
94
|
},
|
|
91
95
|
"engines": {
|
|
92
96
|
"node": ">= 16.0.0"
|
|
@@ -97,6 +101,9 @@
|
|
|
97
101
|
"modulePathIgnorePatterns": [
|
|
98
102
|
"<rootDir>/example/node_modules",
|
|
99
103
|
"<rootDir>/lib/"
|
|
104
|
+
],
|
|
105
|
+
"testPathIgnorePatterns": [
|
|
106
|
+
"<rootDir>/example/"
|
|
100
107
|
]
|
|
101
108
|
},
|
|
102
109
|
"commitlint": {
|
|
@@ -166,8 +173,6 @@
|
|
|
166
173
|
]
|
|
167
174
|
},
|
|
168
175
|
"dependencies": {
|
|
169
|
-
"@visit-health/react-native-location-enabler": "1.0.1",
|
|
170
|
-
"react-native-event-listeners": "^1.0.7",
|
|
171
176
|
"react-native-webview": "^13.12.1"
|
|
172
177
|
},
|
|
173
178
|
"directories": {
|
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.license = package["license"]
|
|
12
12
|
s.authors = package["author"]
|
|
13
13
|
|
|
14
|
-
s.platforms = { :ios => "
|
|
14
|
+
s.platforms = { :ios => "12.4" }
|
|
15
15
|
s.source = { :git => "https://github.com/yash-vardhan-mishra/react-native-visit-rn-sdk.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm}"
|