react-native-mytatva-rn-sdk 1.0.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 (35) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +31 -0
  3. package/android/build.gradle +112 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/visitrnsdk/VisitRnSdkPackage.kt +17 -0
  8. package/android/src/main/java/com/visitrnsdk/VisitRnSdkViewManager.kt +20 -0
  9. package/ios/VisitRnSdk.xcodeproj/project.pbxproj +274 -0
  10. package/ios/VisitRnSdkViewManager.h +20 -0
  11. package/ios/VisitRnSdkViewManager.m +1240 -0
  12. package/lib/commonjs/Services.js +35 -0
  13. package/lib/commonjs/Services.js.map +1 -0
  14. package/lib/commonjs/constants.js +11 -0
  15. package/lib/commonjs/constants.js.map +1 -0
  16. package/lib/commonjs/index.android.js +518 -0
  17. package/lib/commonjs/index.android.js.map +1 -0
  18. package/lib/commonjs/index.ios.js +313 -0
  19. package/lib/commonjs/index.ios.js.map +1 -0
  20. package/lib/module/Services.js +27 -0
  21. package/lib/module/Services.js.map +1 -0
  22. package/lib/module/constants.js +5 -0
  23. package/lib/module/constants.js.map +1 -0
  24. package/lib/module/index.android.js +508 -0
  25. package/lib/module/index.android.js.map +1 -0
  26. package/lib/module/index.ios.js +304 -0
  27. package/lib/module/index.ios.js.map +1 -0
  28. package/lib/typescript/index.test.d.ts +1 -0
  29. package/lib/typescript/index.test.d.ts.map +1 -0
  30. package/package.json +177 -0
  31. package/react-native-visit-rn-sdk.podspec +42 -0
  32. package/src/Services.js +37 -0
  33. package/src/constants.js +4 -0
  34. package/src/index.android.js +714 -0
  35. package/src/index.ios.js +376 -0
@@ -0,0 +1,304 @@
1
+ import React, { useRef, useEffect, useState, useCallback, useMemo } from 'react';
2
+ import { StyleSheet, SafeAreaView, NativeModules, NativeEventEmitter, Linking, Platform, ActivityIndicator, Dimensions } from 'react-native';
3
+ import { EventRegister } from 'react-native-event-listeners';
4
+ import { WebView } from 'react-native-webview';
5
+ import DeviceInfo from 'react-native-device-info';
6
+ import { getWebViewLink, httpClient } from './Services';
7
+ import constants from './constants';
8
+ const LINKING_ERROR = `The package 'react-native-mytatva-rn-sdk' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
9
+ ios: "- You have run 'pod install'\n",
10
+ default: ''
11
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
12
+ const escapeChars = {
13
+ lt: '<',
14
+ gt: '>',
15
+ quot: '"',
16
+ apos: "'",
17
+ amp: '&'
18
+ };
19
+ const unescapeHTML = str =>
20
+ // modified from underscore.string and string.js
21
+ // eslint-disable-next-line no-useless-escape
22
+ str.replace(/\&([^;]+);/g, (entity, entityCode) => {
23
+ let match;
24
+ if (entityCode in escapeChars) {
25
+ return escapeChars[entityCode];
26
+ } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) {
27
+ return String.fromCharCode(parseInt(match[1], 16));
28
+ } else if (match = entityCode.match(/^#(\d+)$/)) {
29
+ return String.fromCharCode(match[1]);
30
+ } else {
31
+ return entity;
32
+ }
33
+ });
34
+ const visitEvent = 'visit-event';
35
+ const MyTatvaRnSdkView = ({
36
+ cpsid,
37
+ baseUrl,
38
+ errorBaseUrl,
39
+ token,
40
+ moduleName,
41
+ environment,
42
+ magicLink,
43
+ isLoggingEnabled
44
+ }) => {
45
+ const [source, setSource] = useState('');
46
+ const [loading, setLoading] = useState(true);
47
+ useEffect(() => {
48
+ var _magicLink$trim;
49
+ if (magicLink !== null && magicLink !== void 0 && (_magicLink$trim = magicLink.trim()) !== null && _magicLink$trim !== void 0 && _magicLink$trim.length) {
50
+ setSource(magicLink);
51
+ setLoading(false);
52
+ } else {
53
+ const systemVersion = DeviceInfo.getSystemVersion();
54
+ const version = DeviceInfo.getVersion();
55
+ DeviceInfo.getUniqueId().then(uniqueId => getWebViewLink(baseUrl, token, cpsid, 'iPhone', uniqueId, version, systemVersion, environment)).then(res => {
56
+ var _res$data;
57
+ if ((_res$data = res.data) !== null && _res$data !== void 0 && _res$data.errorMessage) {
58
+ var _res$data2, _res$data3;
59
+ const {
60
+ errorMessage
61
+ } = res.data;
62
+ const errorUrl = `${errorBaseUrl}/star-health?error=${errorMessage}`;
63
+ setSource(errorUrl);
64
+ if (((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.errorMessage) === 'Please login again') {
65
+ EventRegister.emitEvent(visitEvent, {
66
+ message: 'unauthorized-wellness-access',
67
+ errorMessage: errorMessage
68
+ });
69
+ }
70
+ if ((_res$data3 = res.data) !== null && _res$data3 !== void 0 && _res$data3.errorMessage.includes('External Server Error')) {
71
+ EventRegister.emitEvent('visit-event', {
72
+ message: 'external-server-error',
73
+ errorMessage: errorMessage
74
+ });
75
+ }
76
+ } else if (res.data.message === 'success') {
77
+ var _res$data4, _res$data5;
78
+ const magicCode = (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.magicCode;
79
+ const responseReferenceId = (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.responseReferenceId;
80
+ let finalBaseUrl = '';
81
+ if (magicCode) {
82
+ if (environment.toUpperCase() === 'PROD') {
83
+ finalBaseUrl = constants.PROD_BASE_URL;
84
+ } else {
85
+ finalBaseUrl = constants.STAGE_BASE_URL;
86
+ }
87
+ }
88
+ if (finalBaseUrl && magicCode) {
89
+ let finalUrl = `${finalBaseUrl}=${magicCode}`;
90
+ if (moduleName !== null && moduleName !== void 0 && moduleName.trim()) {
91
+ finalUrl += `&tab=${moduleName}`;
92
+ }
93
+ if (typeof responseReferenceId === 'string' && responseReferenceId.trim().length > 0) {
94
+ finalUrl += `&responseReferenceId=${responseReferenceId}`;
95
+ }
96
+ setSource(finalUrl);
97
+ }
98
+ } else {
99
+ EventRegister.emitEvent('visit-event', {
100
+ message: 'generate-magic-link-failed',
101
+ errorMessage: `${res.data}`
102
+ });
103
+ }
104
+ }).catch(err => {
105
+ console.log('getWebViewLink err', {
106
+ err
107
+ });
108
+ EventRegister.emitEvent('visit-event', {
109
+ message: 'generate-magic-link-failed',
110
+ errorMessage: `${err}`
111
+ });
112
+ }).finally(() => {
113
+ setLoading(false);
114
+ });
115
+ }
116
+ }, [cpsid, token, baseUrl, errorBaseUrl, moduleName, environment, magicLink, isLoggingEnabled]);
117
+ const MyTatvaRnSdkViewManager = useMemo(() => NativeModules.MyTatvaRnSdkViewManager ? NativeModules.MyTatvaRnSdkViewManager : new Proxy({}, {
118
+ get() {
119
+ throw new Error(LINKING_ERROR);
120
+ }
121
+ }), []);
122
+ const webviewRef = useRef(null);
123
+ const [apiBaseUrl, setApiBaseUrl] = useState('');
124
+ const [authToken, setAuthToken] = useState('');
125
+ const [hasLoadedOnce, setHasLoadedOnce] = useState(false);
126
+ const callSyncApi = useCallback(data => httpClient.post(`${apiBaseUrl}/users/data-sync`, data, {
127
+ headers: {
128
+ Authorization: authToken
129
+ }
130
+ }).then(res => console.log('callSyncData response,', res)).catch(err => console.log('callSyncData err,', {
131
+ err
132
+ })), [apiBaseUrl, authToken]);
133
+ const callEmbellishApi = useCallback(data => httpClient.post(`${apiBaseUrl}/users/embellish-sync`, data, {
134
+ headers: {
135
+ Authorization: authToken
136
+ }
137
+ }).then(res => console.log('callEmbellishApi response,', res)).catch(err => console.log('callEmbellishApi err,', {
138
+ err
139
+ })), [apiBaseUrl, authToken]);
140
+ useEffect(() => {
141
+ const apiManagerEmitter = new NativeEventEmitter(MyTatvaRnSdkViewManager);
142
+ const subscription = apiManagerEmitter.addListener('EventReminder', reminder => {
143
+ var _reminder$callSyncDat, _reminder$callEmbelli;
144
+ if (reminder !== null && reminder !== void 0 && reminder.callSyncData && reminder !== null && reminder !== void 0 && (_reminder$callSyncDat = reminder.callSyncData) !== null && _reminder$callSyncDat !== void 0 && _reminder$callSyncDat.length) {
145
+ callSyncApi(reminder === null || reminder === void 0 ? void 0 : reminder.callSyncData[0]);
146
+ }
147
+ if (reminder !== null && reminder !== void 0 && reminder.callEmbellishApi && reminder !== null && reminder !== void 0 && (_reminder$callEmbelli = reminder.callEmbellishApi) !== null && _reminder$callEmbelli !== void 0 && _reminder$callEmbelli.length) {
148
+ callEmbellishApi(reminder === null || reminder === void 0 ? void 0 : reminder.callEmbellishApi[0]);
149
+ }
150
+ });
151
+ return () => {
152
+ subscription.remove();
153
+ };
154
+ }, [MyTatvaRnSdkViewManager, callEmbellishApi, callSyncApi]);
155
+ const handleMessage = async event => {
156
+ var _webviewRef$current, _webviewRef$current6;
157
+ const data = JSON.parse(unescapeHTML(event.nativeEvent.data));
158
+ const {
159
+ method,
160
+ type,
161
+ frequency,
162
+ timestamp,
163
+ // eslint-disable-next-line no-shadow
164
+ apiBaseUrl,
165
+ authtoken,
166
+ googleFitLastSync,
167
+ gfHourlyLastSync,
168
+ url
169
+ } = data;
170
+ console.log('handleMessage data is', data);
171
+ console.log(unescapeHTML(event.nativeEvent.data));
172
+ switch (method) {
173
+ case 'UPDATE_PLATFORM':
174
+ (_webviewRef$current = webviewRef.current) === null || _webviewRef$current === void 0 || _webviewRef$current.injectJavaScript('window.setSdkPlatform("IOS")');
175
+ break;
176
+ case 'CONNECT_TO_GOOGLE_FIT':
177
+ if (DeviceInfo.getModel() === 'iPad') {
178
+ var _webviewRef$current2;
179
+ console.log('unsupportedHealthKitDevice triggered');
180
+ (_webviewRef$current2 = webviewRef.current) === null || _webviewRef$current2 === void 0 || _webviewRef$current2.injectJavaScript('window.unsupportedHealthKitDevice(true)');
181
+ } else {
182
+ MyTatvaRnSdkViewManager === null || MyTatvaRnSdkViewManager === void 0 || MyTatvaRnSdkViewManager.connectToAppleHealth(res => {
183
+ if (res !== null && res !== void 0 && res.sleepTime || res !== null && res !== void 0 && res.numberOfSteps) {
184
+ var _webviewRef$current3;
185
+ (_webviewRef$current3 = webviewRef.current) === null || _webviewRef$current3 === void 0 || _webviewRef$current3.injectJavaScript(`window.updateFitnessPermissions(true,${res === null || res === void 0 ? void 0 : res.numberOfSteps},${res === null || res === void 0 ? void 0 : res.sleepTime})`);
186
+ } else {
187
+ var _webviewRef$current4;
188
+ (_webviewRef$current4 = webviewRef.current) === null || _webviewRef$current4 === void 0 || _webviewRef$current4.injectJavaScript('window.updateFitnessPermissions(true,0,0)');
189
+ }
190
+ });
191
+ }
192
+ break;
193
+ case 'GET_DATA_TO_GENERATE_GRAPH':
194
+ MyTatvaRnSdkViewManager === null || MyTatvaRnSdkViewManager === void 0 || MyTatvaRnSdkViewManager.renderGraph({
195
+ type,
196
+ frequency,
197
+ timestamp
198
+ }, (err, results) => {
199
+ if (err) {
200
+ console.log('error initializing Healthkit: ', err);
201
+ return;
202
+ }
203
+ if (results[0]) {
204
+ var _webviewRef$current5;
205
+ console.log('results initializing Healthkit: ', results[0]);
206
+ (_webviewRef$current5 = webviewRef.current) === null || _webviewRef$current5 === void 0 || _webviewRef$current5.injectJavaScript(`window.${results[0]}`);
207
+ }
208
+ });
209
+ break;
210
+ case 'UPDATE_API_BASE_URL':
211
+ if (!hasLoadedOnce) {
212
+ console.log('apiBaseUrl is,', apiBaseUrl);
213
+ setApiBaseUrl(apiBaseUrl);
214
+ setAuthToken(authtoken);
215
+ MyTatvaRnSdkViewManager === null || MyTatvaRnSdkViewManager === void 0 || MyTatvaRnSdkViewManager.updateApiUrl({
216
+ googleFitLastSync,
217
+ gfHourlyLastSync
218
+ });
219
+ setHasLoadedOnce(true);
220
+ }
221
+ break;
222
+ case 'OPEN_PDF':
223
+ Linking.openURL(url);
224
+ break;
225
+ case 'CLOSE_VIEW':
226
+ break;
227
+ case 'GET_LOCATION_PERMISSIONS':
228
+ (_webviewRef$current6 = webviewRef.current) === null || _webviewRef$current6 === void 0 || _webviewRef$current6.injectJavaScript('window.checkTheGpsPermission(true)');
229
+ break;
230
+ default:
231
+ break;
232
+ }
233
+ };
234
+ const {
235
+ height,
236
+ width
237
+ } = Dimensions.get('screen');
238
+ return (
239
+ /*#__PURE__*/
240
+ // eslint-disable-next-line react-native/no-inline-styles
241
+ React.createElement(SafeAreaView, {
242
+ style: {
243
+ flex: 1,
244
+ backgroundColor: 'white',
245
+ height,
246
+ width
247
+ }
248
+ }, loading ? /*#__PURE__*/React.createElement(LoadingIndicator, null) : /*#__PURE__*/React.createElement(WebView, {
249
+ ref: webviewRef,
250
+ source: {
251
+ uri: source
252
+ },
253
+ style: styles.webView,
254
+ javascriptEnabled: true,
255
+ onMessage: handleMessage,
256
+ onError: errorMessage => {
257
+ EventRegister.emitEvent(visitEvent, {
258
+ message: 'web-view-error',
259
+ errorMessage: errorMessage
260
+ });
261
+ if (isLoggingEnabled) {
262
+ console.warn('Webview error: ', errorMessage);
263
+ }
264
+ }
265
+ }))
266
+ );
267
+ };
268
+ const styles = StyleSheet.create({
269
+ webViewContainer: {
270
+ flex: 1,
271
+ backgroundColor: 'white'
272
+ },
273
+ webView: {
274
+ flex: 1
275
+ }
276
+ });
277
+ MyTatvaRnSdkView.defaultProps = {
278
+ id: '',
279
+ token: '',
280
+ baseUrl: '',
281
+ errorBaseUrl: '',
282
+ moduleName: ''
283
+ };
284
+ export default MyTatvaRnSdkView;
285
+ const LoadingIndicator = () => {
286
+ return /*#__PURE__*/React.createElement(ActivityIndicator, {
287
+ color: "#000",
288
+ size: "small"
289
+ // eslint-disable-next-line react-native/no-inline-styles
290
+ ,
291
+ style: {
292
+ flex: 1,
293
+ zIndex: 100,
294
+ position: 'absolute',
295
+ backgroundColor: '#fff',
296
+ opacity: 0.4,
297
+ width: '100%',
298
+ height: '100%',
299
+ justifyContent: 'center',
300
+ alignItems: 'center'
301
+ }
302
+ });
303
+ };
304
+ //# sourceMappingURL=index.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useRef","useEffect","useState","useCallback","useMemo","StyleSheet","SafeAreaView","NativeModules","NativeEventEmitter","Linking","Platform","ActivityIndicator","Dimensions","EventRegister","WebView","DeviceInfo","getWebViewLink","httpClient","constants","LINKING_ERROR","select","ios","default","escapeChars","lt","gt","quot","apos","amp","unescapeHTML","str","replace","entity","entityCode","match","String","fromCharCode","parseInt","visitEvent","MyTatvaRnSdkView","cpsid","baseUrl","errorBaseUrl","token","moduleName","environment","magicLink","isLoggingEnabled","source","setSource","loading","setLoading","_magicLink$trim","trim","length","systemVersion","getSystemVersion","version","getVersion","getUniqueId","then","uniqueId","res","_res$data","data","errorMessage","_res$data2","_res$data3","errorUrl","emitEvent","message","includes","_res$data4","_res$data5","magicCode","responseReferenceId","finalBaseUrl","toUpperCase","PROD_BASE_URL","STAGE_BASE_URL","finalUrl","catch","err","console","log","finally","MyTatvaRnSdkViewManager","Proxy","get","Error","webviewRef","apiBaseUrl","setApiBaseUrl","authToken","setAuthToken","hasLoadedOnce","setHasLoadedOnce","callSyncApi","post","headers","Authorization","callEmbellishApi","apiManagerEmitter","subscription","addListener","reminder","_reminder$callSyncDat","_reminder$callEmbelli","callSyncData","remove","handleMessage","event","_webviewRef$current","_webviewRef$current6","JSON","parse","nativeEvent","method","type","frequency","timestamp","authtoken","googleFitLastSync","gfHourlyLastSync","url","current","injectJavaScript","getModel","_webviewRef$current2","connectToAppleHealth","sleepTime","numberOfSteps","_webviewRef$current3","_webviewRef$current4","renderGraph","results","_webviewRef$current5","updateApiUrl","openURL","height","width","createElement","style","flex","backgroundColor","LoadingIndicator","ref","uri","styles","webView","javascriptEnabled","onMessage","onError","warn","create","webViewContainer","defaultProps","id","color","size","zIndex","position","opacity","justifyContent","alignItems"],"sourceRoot":"../../src","sources":["index.ios.js"],"mappings":"AAAA,OAAOA,KAAK,IACVC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,WAAW,EACXC,OAAO,QACF,OAAO;AACd,SACEC,UAAU,EACVC,YAAY,EACZC,aAAa,EACbC,kBAAkB,EAClBC,OAAO,EACPC,QAAQ,EACRC,iBAAiB,EACjBC,UAAU,QACL,cAAc;AACrB,SAASC,aAAa,QAAQ,8BAA8B;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C","ignoreList":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/index.test.tsx"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,177 @@
1
+ {
2
+ "name": "react-native-mytatva-rn-sdk",
3
+ "version": "1.0.0",
4
+ "description": "a package to inject data into visit health pwa",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "android",
14
+ "ios",
15
+ "cpp",
16
+ "*.podspec",
17
+ "!lib/typescript/example",
18
+ "!ios/build",
19
+ "!android/build",
20
+ "!android/gradle",
21
+ "!android/gradlew",
22
+ "!android/gradlew.bat",
23
+ "!android/local.properties",
24
+ "!**/__tests__",
25
+ "!**/__fixtures__",
26
+ "!**/__mocks__",
27
+ "!**/.*"
28
+ ],
29
+ "scripts": {
30
+ "test": "jest",
31
+ "typecheck": "tsc --noEmit",
32
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
33
+ "prepack": "bob build",
34
+ "release": "release-it",
35
+ "example": "yarn --cwd example",
36
+ "build:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
37
+ "build:ios": "cd example/ios && xcodebuild -workspace VisitRnSdkExample.xcworkspace -scheme VisitRnSdkExample -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",
38
+ "bootstrap": "yarn example && yarn install && yarn example pods",
39
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
40
+ },
41
+ "keywords": [
42
+ "react-native",
43
+ "ios",
44
+ "android"
45
+ ],
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/DHSPL-Tatvacare/Mytatva-ReactNative"
49
+ },
50
+ "author": "Sonu Sharma <sonu.sharma@tatvacare.in> (https://github.com/yash-vardhan-mishra)",
51
+ "license": "MIT",
52
+ "bugs": {
53
+ "url": "https://github.com/DHSPL-Tatvacare/Mytatva-ReactNative/issues"
54
+ },
55
+ "homepage": "https://github.com/DHSPL-Tatvacare/Mytatva-ReactNative",
56
+ "publishConfig": {
57
+ "registry": "https://registry.npmjs.org/"
58
+ },
59
+ "devDependencies": {
60
+ "@commitlint/config-conventional": "^17.0.2",
61
+ "@evilmartians/lefthook": "^1.2.2",
62
+ "@react-native-community/eslint-config": "^3.0.2",
63
+ "@release-it/conventional-changelog": "^5.0.0",
64
+ "@types/jest": "^28.1.2",
65
+ "@types/react": "~17.0.21",
66
+ "@types/react-native": "0.70.0",
67
+ "commitlint": "^17.0.2",
68
+ "del-cli": "^5.0.0",
69
+ "eslint": "^8.4.1",
70
+ "eslint-config-prettier": "^8.5.0",
71
+ "eslint-plugin-prettier": "^4.0.0",
72
+ "jest": "^28.1.1",
73
+ "pod-install": "^0.1.0",
74
+ "prettier": "^2.0.5",
75
+ "react": "18.2.0",
76
+ "react-native": "0.72.4",
77
+ "react-native-builder-bob": "^0.20.0",
78
+ "release-it": "^15.0.0",
79
+ "turbo": "^1.10.7",
80
+ "typescript": "^5.0.2"
81
+ },
82
+ "resolutions": {
83
+ "@types/react": "17.0.21"
84
+ },
85
+ "peerDependencies": {
86
+ "react": "*",
87
+ "react-native": "*"
88
+ },
89
+ "engines": {
90
+ "node": ">= 16.0.0"
91
+ },
92
+ "packageManager": "^yarn@1.22.15",
93
+ "jest": {
94
+ "preset": "react-native",
95
+ "modulePathIgnorePatterns": [
96
+ "<rootDir>/example/node_modules",
97
+ "<rootDir>/lib/"
98
+ ]
99
+ },
100
+ "commitlint": {
101
+ "extends": [
102
+ "@commitlint/config-conventional"
103
+ ]
104
+ },
105
+ "release-it": {
106
+ "git": {
107
+ "commitMessage": "chore: release ${version}",
108
+ "tagName": "v${version}"
109
+ },
110
+ "npm": {
111
+ "publish": true
112
+ },
113
+ "github": {
114
+ "release": true
115
+ },
116
+ "plugins": {
117
+ "@release-it/conventional-changelog": {
118
+ "preset": "angular"
119
+ }
120
+ }
121
+ },
122
+ "eslintConfig": {
123
+ "root": true,
124
+ "extends": [
125
+ "@react-native-community",
126
+ "prettier"
127
+ ],
128
+ "rules": {
129
+ "prettier/prettier": [
130
+ "error",
131
+ {
132
+ "quoteProps": "consistent",
133
+ "singleQuote": true,
134
+ "tabWidth": 2,
135
+ "trailingComma": "es5",
136
+ "useTabs": false
137
+ }
138
+ ]
139
+ }
140
+ },
141
+ "eslintIgnore": [
142
+ "node_modules/",
143
+ "lib/"
144
+ ],
145
+ "prettier": {
146
+ "quoteProps": "consistent",
147
+ "singleQuote": true,
148
+ "tabWidth": 2,
149
+ "trailingComma": "es5",
150
+ "useTabs": false
151
+ },
152
+ "react-native-builder-bob": {
153
+ "source": "src",
154
+ "output": "lib",
155
+ "targets": [
156
+ "commonjs",
157
+ "module",
158
+ [
159
+ "typescript",
160
+ {
161
+ "project": "tsconfig.build.json"
162
+ }
163
+ ]
164
+ ]
165
+ },
166
+ "dependencies": {
167
+ "axios": "^1.5.0",
168
+ "moment": "^2.29.4",
169
+ "react-native-device-info": "13.0.0",
170
+ "react-native-event-listeners": "^1.0.7",
171
+ "react-native-location-enabler": "git+https://github.com/sashko9807/react-native-location-enabler.git",
172
+ "react-native-webview": "^13.12.1"
173
+ },
174
+ "directories": {
175
+ "example": "example"
176
+ }
177
+ }
@@ -0,0 +1,42 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
+
6
+ Pod::Spec.new do |s|
7
+ s.name = "react-native-mytatva-rn-sdk"
8
+ s.version = package["version"]
9
+ s.summary = package["description"]
10
+ s.homepage = package["homepage"]
11
+ s.license = package["license"]
12
+ s.authors = package["author"]
13
+
14
+ s.platforms = { :ios => "11.0" }
15
+ s.source = { :git => "https://github.com/yash-vardhan-mishra/react-native-visit-rn-sdk.git", :tag => "#{s.version}" }
16
+
17
+ s.source_files = "ios/**/*.{h,m,mm}"
18
+
19
+ # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
20
+ # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
21
+ if respond_to?(:install_modules_dependencies, true)
22
+ install_modules_dependencies(s)
23
+ else
24
+ s.dependency "React-Core"
25
+
26
+ # Don't install the dependencies when we run `pod install` in the old architecture.
27
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
28
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
29
+ s.pod_target_xcconfig = {
30
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
31
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
32
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
33
+ }
34
+ s.dependency "React-RCTFabric"
35
+ s.dependency "React-Codegen"
36
+ s.dependency "RCT-Folly"
37
+ s.dependency "RCTRequired"
38
+ s.dependency "RCTTypeSafety"
39
+ s.dependency "ReactCommon/turbomodule/core"
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,37 @@
1
+ import axios from 'axios';
2
+
3
+ export const httpClient = axios.create({
4
+ timeout: 60000,
5
+ });
6
+
7
+ export const getWebViewLink = (
8
+ baseUrl,
9
+ token,
10
+ cpsid,
11
+ srcClientId,
12
+ deviceId,
13
+ appVersion,
14
+ deviceVersion,
15
+ userEnv
16
+ ) => {
17
+ const data = {
18
+ cpsid,
19
+ token,
20
+ srcClientId,
21
+ deviceId,
22
+ appVersion,
23
+ deviceVersion,
24
+ userEnv,
25
+ };
26
+
27
+ return httpClient
28
+ .post(`${baseUrl}/partners/v3/generate-magic-link-star-health`, data)
29
+ .then((res) => {
30
+ console.log('getWebViewLink res', { res });
31
+ return res;
32
+ })
33
+ .catch((err) => {
34
+ console.log('getWebViewLink err', { err });
35
+ return err;
36
+ });
37
+ };
@@ -0,0 +1,4 @@
1
+ export default {
2
+ STAGE_BASE_URL: 'https://star-health.getvisitapp.net/?mluib7c',
3
+ PROD_BASE_URL: 'https://star-health.getvisitapp.com/?mluib7c',
4
+ };