react-native-visit-rn-sdk 6.0.3 → 7.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 (93) hide show
  1. package/README.md +288 -122
  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/Services.js +35 -0
  12. package/lib/commonjs/Services.js.map +1 -0
  13. package/lib/commonjs/constants.js +11 -0
  14. package/lib/commonjs/constants.js.map +1 -0
  15. package/lib/commonjs/index.android.js +450 -205
  16. package/lib/commonjs/index.android.js.map +1 -1
  17. package/lib/commonjs/index.ios.js +266 -114
  18. package/lib/commonjs/index.ios.js.map +1 -1
  19. package/lib/module/Services.js +27 -0
  20. package/lib/module/Services.js.map +1 -0
  21. package/lib/module/constants.js +5 -0
  22. package/lib/module/constants.js.map +1 -0
  23. package/lib/module/index.android.js +450 -206
  24. package/lib/module/index.android.js.map +1 -1
  25. package/lib/module/index.ios.js +268 -116
  26. package/lib/module/index.ios.js.map +1 -1
  27. package/lib/typescript/Services.d.ts +3 -0
  28. package/lib/typescript/Services.d.ts.map +1 -0
  29. package/lib/typescript/constants.d.ts +6 -0
  30. package/lib/typescript/constants.d.ts.map +1 -0
  31. package/lib/typescript/index.android.d.ts +26 -3
  32. package/lib/typescript/index.android.d.ts.map +1 -1
  33. package/lib/typescript/index.ios.d.ts +20 -3
  34. package/lib/typescript/index.ios.d.ts.map +1 -1
  35. package/package.json +14 -25
  36. package/react-native-visit-rn-sdk.podspec +2 -1
  37. package/src/Services.js +37 -0
  38. package/src/constants.js +4 -0
  39. package/src/index.android.js +773 -0
  40. package/src/index.ios.js +429 -0
  41. package/android/src/main/java/com/visitrnsdk/VisitRnSdkLocationModule.kt +0 -37
  42. package/lib/commonjs/assets/video-call/connecting-lottie.gif +0 -0
  43. package/lib/commonjs/assets/video-call/end-call.png +0 -0
  44. package/lib/commonjs/assets/video-call/mic-off.png +0 -0
  45. package/lib/commonjs/assets/video-call/reconnecting.gif +0 -0
  46. package/lib/commonjs/assets/video-call/switch-camera.png +0 -0
  47. package/lib/commonjs/assets/video-call/toggle-down.png +0 -0
  48. package/lib/commonjs/assets/video-call/toggle-up.png +0 -0
  49. package/lib/commonjs/assets/video-call/video-off.png +0 -0
  50. package/lib/commonjs/components/VideoCallComponent.js +0 -1088
  51. package/lib/commonjs/components/VideoCallComponent.js.map +0 -1
  52. package/lib/commonjs/index.js +0 -6
  53. package/lib/commonjs/index.js.map +0 -1
  54. package/lib/commonjs/shims.d.js +0 -2
  55. package/lib/commonjs/shims.d.js.map +0 -1
  56. package/lib/commonjs/types.js +0 -2
  57. package/lib/commonjs/types.js.map +0 -1
  58. package/lib/module/assets/video-call/connecting-lottie.gif +0 -0
  59. package/lib/module/assets/video-call/end-call.png +0 -0
  60. package/lib/module/assets/video-call/mic-off.png +0 -0
  61. package/lib/module/assets/video-call/reconnecting.gif +0 -0
  62. package/lib/module/assets/video-call/switch-camera.png +0 -0
  63. package/lib/module/assets/video-call/toggle-down.png +0 -0
  64. package/lib/module/assets/video-call/toggle-up.png +0 -0
  65. package/lib/module/assets/video-call/video-off.png +0 -0
  66. package/lib/module/components/VideoCallComponent.js +0 -1081
  67. package/lib/module/components/VideoCallComponent.js.map +0 -1
  68. package/lib/module/index.js +0 -2
  69. package/lib/module/index.js.map +0 -1
  70. package/lib/module/shims.d.js +0 -2
  71. package/lib/module/shims.d.js.map +0 -1
  72. package/lib/module/types.js +0 -2
  73. package/lib/module/types.js.map +0 -1
  74. package/lib/typescript/components/VideoCallComponent.d.ts +0 -79
  75. package/lib/typescript/components/VideoCallComponent.d.ts.map +0 -1
  76. package/lib/typescript/index.d.ts +0 -17
  77. package/lib/typescript/index.d.ts.map +0 -1
  78. package/lib/typescript/types.d.ts +0 -24
  79. package/lib/typescript/types.d.ts.map +0 -1
  80. package/src/assets/video-call/connecting-lottie.gif +0 -0
  81. package/src/assets/video-call/end-call.png +0 -0
  82. package/src/assets/video-call/mic-off.png +0 -0
  83. package/src/assets/video-call/reconnecting.gif +0 -0
  84. package/src/assets/video-call/switch-camera.png +0 -0
  85. package/src/assets/video-call/toggle-down.png +0 -0
  86. package/src/assets/video-call/toggle-up.png +0 -0
  87. package/src/assets/video-call/video-off.png +0 -0
  88. package/src/components/VideoCallComponent.tsx +0 -1484
  89. package/src/index.android.tsx +0 -459
  90. package/src/index.ios.tsx +0 -238
  91. package/src/index.tsx +0 -25
  92. package/src/shims.d.ts +0 -49
  93. package/src/types.ts +0 -25
package/README.md CHANGED
@@ -1,174 +1,340 @@
1
- # react-native-visit-rn-sdk
1
+ ### **Instructions for configuring your Android Project**
2
+
3
+ * Install Visit React Native Plugin
4
+ `npm install react-native-visit-rn-sdk@7.0.0`
5
+ * Install these transitive plugins that Visit Plugin requires internally:
6
+ `npm install react-native-device-info`
7
+ `npm install https://github.com/sashko9807/react-native-location-enabler`
8
+ `npm install react-native-event-listeners`
9
+ `npm install react-native-webview`
10
+ * Add `https://jitpack.io` to the host app’s Gradle repositories for `com.github.VisitApp:AndroidSDK`.
11
+ * Enable code desugaring in your app, or there add the dependency.
2
12
 
3
- a package to inject data into visit health pwa
13
+ ```
14
+ coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
15
+ ```
4
16
 
5
- ## Installation
17
+ * Inside the `:app` `build.gradle` android block specify these.
6
18
 
7
- ```sh
8
- npm install react-native-visit-rn-sdk @twilio/video-react-native-sdk@3.5.0 react-native-permissions@4.1.5 --legacy-peer-deps
9
19
  ```
10
20
 
11
- The minimum supported iOS deployment target is `12.4`.
12
-
13
- ## Usage
21
+ android {
22
+ compileOptions {
23
+ coreLibraryDesugaringEnabled true
24
+ sourceCompatibility JavaVersion.VERSION_17
25
+ targetCompatibility JavaVersion.VERSION_17
26
+ }
27
+ }
28
+ ```
14
29
 
15
- ```tsx
16
- import { useRef } from 'react';
17
- import VisitRnSdkView, {
18
- type VisitRnSdkViewHandle,
19
- type VisitRnSdkViewProps,
20
- } from 'react-native-visit-rn-sdk';
30
+ * In the `AndroidManifest.xml` file, add the metadata tag to serve the privacy manifest URL
21
31
 
22
- const sdkRef = useRef<VisitRnSdkViewHandle>(null);
32
+ ```
33
+ <meta-data
34
+ android:name="visit_android_sdk.health_connect_privacy_policy_url"
35
+ android:value="https://www.google.com" />
36
+ ```
37
+ * Version Requirement:
38
+ AGP: `8.13.2` or higher
39
+ Kotlin: `1.9.25`or higher
40
+ `compileSdkVersion`: 36 or higher
23
41
 
24
- const props: VisitRnSdkViewProps = {
25
- ssoLink: 'pre-generated-sso-link',
26
- // isLoggingEnabled is optional (boolean); defaults to false
27
- onEvent: (eventName, properties) => {
28
- if (eventName === 'INITIATE_PAYMENT') {
29
- // Open the host payment PWA. Keep VisitRnSdkView mounted.
30
- }
31
- },
32
- };
42
+ ‌
33
43
 
34
- <VisitRnSdkView {...props} ref={sdkRef} />;
44
+ ### **Instructions for configuring Plugin in iOS project**
35
45
 
36
- // After the host payment PWA finishes:
37
- sdkRef.current?.sendEvent('PAYMENT_STATUS', { status: 'success' });
38
- ```
46
+ * Add the plugin `npm install react-native-visit-rn-sdk@7.0.0 && npx pod-install`
47
+ * Install pods(for M1 processors running build on `x86_64` hardware)
39
48
 
40
- `isLoggingEnabled` is optional. When omitted it defaults to `false`; if you pass it, the value must be a `boolean`.
49
+ `arch -x86_64 pod install`
41
50
 
42
- `VisitRnSdkViewProps` and `VisitRnSdkViewHandle` are exported for host apps that want to type wrappers or prop maps.
43
51
 
44
- ### Host ↔ Visit PWA events
52
+ * In the Signing & Capabilities section in Xcode, add HealthKit as a capability
53
+ * Add this read-only HealthKit key inside the `Info.plist` file. Use it to explain why the app reads steps, calories, distance, and sleep from HealthKit.
45
54
 
46
- Keep `VisitRnSdkView` mounted while the host payment UI is open.
55
+ ```
56
+ <key>NSHealthShareUsageDescription</key>
57
+ <string>Visit requires your permission to read health and fitness data.</string>
58
+ ```
47
59
 
48
- - **PWA → host:** the PWA posts a WebView message with method `sendEventToHost` which is forwarded to `onEvent`.
60
+ # **Usage**
49
61
 
50
- ```js
51
- window.ReactNativeWebView.postMessage(JSON.stringify({
52
- method: 'sendEventToHost',
53
- eventName: 'INITIATE_PAYMENT',
54
- ...otherParams
55
- }));
62
+ ```
63
+ import React from 'react';
64
+ import VisitRnSdkView from 'react-native-visit-rn-sdk';
65
+ import {EventRegister} from 'react-native-event-listeners';
66
+ import {SafeAreaView, Alert} from 'react-native';
67
+
68
+ function App() {
69
+
70
+ return (
71
+ <SafeAreaView style={{flex: 1}}>
72
+ <VisitRnSdkView
73
+ magicLink={<Enter the sso link here>}
74
+ isLoggingEnabled={true}
75
+ }
76
+ />
77
+ </SafeAreaView>
78
+ );
79
+ }
80
+
81
+ export default App;
56
82
  ```
57
83
 
58
- - **Host → PWA:** call `sendEvent` on the SDK ref. The Visit PWA must implement:
59
-
60
- ```js
61
- window.sendEventToVisit = function (eventName, properties) {
62
- // TODO
63
- };
84
+ To see the full usage code for getting Health Connect/HealthKit connection status and retrieving health data, refer [here](https://github.com/VisitApp/Visit-ReactNative/blob/mchi-rn-sdk-3x/example/App.js).
85
+
86
+ ## **Example App SDK Initialization and Manual Step Sync**
87
+
88
+ The example app separates health SDK setup, WebView-driven sync setup, and the
89
+ sync request itself. On the first eligible `Home` focus, it automatically
90
+ checks the platform connection, fetches today's metrics, and starts manual
91
+ sync only if the step read succeeds. The button remains available for later
92
+ manual retries.
93
+
94
+ ```mermaid
95
+ flowchart TD
96
+ A["App opens on Home"] --> B{"Platform"}
97
+ B -->|Android| C["Home useEffect calls<br/>VisitFitnessModule.initiateSDK(true)"]
98
+ C --> D["Native module creates the Health Connect utility,<br/>step-sync helper, and session storage"]
99
+ D --> E["Home focus checks Health Connect status"]
100
+ B -->|iOS| F["Home focus checks HealthKit status<br/>No explicit initiateSDK call"]
101
+ F --> G{"Health status"}
102
+ E --> G
103
+ G -->|CONNECTED| H["Fetch today's metrics"]
104
+ G -->|Any other status| I["Do not sync and keep<br/>Start Step Sync disabled"]
105
+ H --> Y{"Today step count fetched?"}
106
+ Y -->|No| Z["Show an error and do not sync"]
107
+ Y -->|Yes| AA{"First eligible Home focus?"}
108
+ AA -->|Yes| R["Start automatic manual sync"]
109
+ AA -->|No| Q["Refresh metrics and keep<br/>Start Step Sync available"]
110
+
111
+ A --> J["User selects Go to next page"]
112
+ J --> K["VisitPage mounts VisitRnSdkView"]
113
+ K --> L["Visit WebView loads the SSO URL"]
114
+ L --> M["PWA posts UPDATE_API_BASE_URL"]
115
+ M --> N["Native layer stores API credentials<br/>and daily/hourly timestamps"]
116
+ N --> O["Native layer attempts the initial sync<br/>when its platform preconditions pass"]
117
+ O --> P["User returns to Home"]
118
+ P --> G
119
+
120
+ Q --> AB["User selects Start Step Sync"]
121
+ AB --> R
122
+ R --> S{"Platform"}
123
+ S -->|Android| T["VisitFitnessModule.triggerManualSync()"]
124
+ S -->|iOS| U["VisitRnSdkViewManager.triggerManualSync()"]
125
+ T --> V["Validate state, collect hourly/daily steps,<br/>and send them to Visit"]
126
+ U --> V
127
+ V -->|Resolved| W["Show the success message"]
128
+ V -->|Rejected| X["Show the native error message"]
64
129
  ```
65
130
 
66
- ## Location permissions
131
+ ### **1. Home Mount and Health Status**
132
+
133
+ On Android, the `Home` component's mount effect calls
134
+ `NativeModules.VisitFitnessModule.initiateSDK(true)`. The native method uses
135
+ the current Activity to create `HealthConnectUtil`, `VisitStepSyncHelper`, and
136
+ `VisitSessionStorage`. `App.js` then immediately sets
137
+ `isAndroidSDKInitialized` to `true`; `initiateSDK` is a void bridge call, so
138
+ this React state does not confirm that native initialization succeeded. If
139
+ `currentActivity` is `null`, the native method skips initialization. Mounting
140
+ `VisitRnSdkView` on Android calls `initiateSDK` again, which gives the SDK
141
+ another opportunity to initialize with an available Activity.
142
+
143
+ Once the Android React flag is true and `Home` is focused,
144
+ `runHealthStatusFlow()` calls `getHealthConnectStatus()`. On iOS, there is no
145
+ equivalent `initiateSDK` call in `App.js`; each `Home` focus calls
146
+ `VisitRnSdkViewManager.getHealthKitConnectStatus()` directly.
147
+
148
+ For either platform, a `CONNECTED` result triggers
149
+ `fetchTodayHealthMetrics()`, which requests today's steps, sleep minutes, and
150
+ calories from the platform-native module. The helper reports whether the step
151
+ request succeeded. On the first eligible `Home` focus, a successful step read
152
+ continues directly into manual sync; a failed step read shows an error and
153
+ blocks that automatic attempt. Other connection states do not fetch metrics or
154
+ start sync.
155
+
156
+ An in-memory ref records the first automatic attempt. Later `Home` focuses
157
+ refresh connection status and metrics but do not automatically sync again
158
+ during the same component lifetime.
159
+
160
+ ### **2. WebView Setup and Initial Sync**
161
+
162
+ Selecting **Go to next page** navigates to `VisitPage` and mounts
163
+ `VisitRnSdkView` with the entered SSO URL. After the Visit PWA loads, it must
164
+ post an `UPDATE_API_BASE_URL` message containing `apiBaseUrl`, `authtoken`,
165
+ `googleFitLastSync`, and `gfHourlyLastSync`.
166
+
167
+ The SDK handles that message as follows:
168
+
169
+ * Android calls `VisitFitnessModule.updateApiBaseUrl()`, which stores the
170
+ values in `VisitSessionStorage` and starts the initial sync once per native
171
+ module lifecycle, unless a sync is already running. A failed initial sync
172
+ can be attempted again when the values are updated later.
173
+ * iOS calls `VisitRnSdkViewManager.updateApiUrl()` once per mounted
174
+ `VisitRnSdkView`, stores the available non-empty credentials and positive
175
+ timestamps in `NSUserDefaults`, and attempts the initial sync when HealthKit
176
+ is available, credentials are present, permission is available, and no
177
+ other sync is running.
178
+
179
+ The initial sync and the manual sync share the same native in-progress guard.
180
+ Returning to `Home` while the initial sync is still running can therefore make
181
+ an explicit button attempt reject with `SYNC_IN_PROGRESS`.
182
+
183
+ > **Ordering requirement:** `CONNECTED` only represents Health Connect or
184
+ > HealthKit access. It does not mean that the Visit API credentials and sync
185
+ > timestamps are ready. On a fresh install or after clearing app data, mount
186
+ > `VisitRnSdkView` and allow it to process `UPDATE_API_BASE_URL` before either
187
+ > automatic or button-driven sync. Otherwise, sync can reject with
188
+ > `MISSING_SYNC_CREDENTIALS` or `MISSING_SYNC_TIMESTAMPS` even though health
189
+ > access is connected. The automatic attempt runs only once per `Home` mount,
190
+ > so after visiting `VisitPage`, use **Start Step Sync** to retry.
191
+
192
+ ### **3. Automatic and Button-Driven Step Sync**
193
+
194
+ The first eligible `Home` focus uses a shared in-flight lock while it checks
195
+ the connection and fetches today's metrics. This disables **Start Step Sync**
196
+ during preparation and prevents the button from overlapping the automatic
197
+ request. A successful step read calls the shared native sync executor.
198
+
199
+ The button remains enabled when the health connection status is `CONNECTED`
200
+ and no sync flow is running. Automatic and button-driven requests both:
201
+
202
+ 1. Set `syncStatus` to `syncing` and show **Syncing in progress...**.
203
+ 2. Call `VisitFitnessModule.triggerManualSync()` on Android or
204
+ `VisitRnSdkViewManager.triggerManualSync()` on iOS.
205
+ 3. Let the native module validate its prerequisites and then collect and
206
+ upload the hourly and daily step data using the stored timestamps,
207
+ credentials, and Visit endpoints.
208
+ 4. On resolution, set the status to `success` and show **Syncing has been
209
+ done successfully**. On rejection, set the status to `error` and show
210
+ the native error message.
211
+
212
+ The resolved native status string is written to the console, but the example
213
+ shows its own fixed success message. A completed manual sync also does not
214
+ automatically reload the three metric cards; those are refreshed the next
215
+ time the focused-screen status flow calls `fetchTodayHealthMetrics()`.
216
+
217
+ ### **Manual Sync Preflight and Failures**
218
+
219
+ | Platform | Code | When it occurs |
220
+ | --- | --- | --- |
221
+ | Android | `SDK_NOT_INITIALIZED` | Session storage, the Health Connect utility, or the step-sync helper was not initialized. |
222
+ | iOS | `HEALTH_DATA_UNAVAILABLE` | HealthKit is unavailable on the device. |
223
+ | Both | `SYNC_IN_PROGRESS` | The initial WebView-driven sync or another manual sync is still running. |
224
+ | Both | `MISSING_SYNC_CREDENTIALS` | The WebView has not stored a non-empty Visit API base URL and auth token. |
225
+ | Android | `MISSING_SYNC_TIMESTAMPS` | Either the stored daily or hourly timestamp is negative. |
226
+ | iOS | `MISSING_SYNC_TIMESTAMPS` | Both stored timestamps are zero or missing. |
227
+ | iOS | `PERMISSION_DENIED` | HealthKit access is not available when the manual sync starts. |
228
+ | Both | `SYNC_FAILED` | The native sync pipeline reports a failure; on iOS this contains the first network or non-2xx Visit response. |
229
+
230
+ After the preflight passes, Android delegates the hourly and daily work to
231
+ `VisitStepSyncHelper`. iOS runs both flows through its shared sync executor.
232
+ The iOS executor posts hourly batches to `/users/embellish-sync` and daily
233
+ data to `/users/data-sync`; the manual promise resolves only after both flows
234
+ finish.
235
+
236
+ ## Fitness data and Health Connect connection
237
+
238
+ The SDK reads steps, calories, distance, and sleep from Health Connect on Android
239
+ and HealthKit on iOS. Android also reads exercise duration for activity totals.
240
+ Health Connect history access is optional. The iOS host app needs the HealthKit
241
+ capability and an `NSHealthShareUsageDescription` that explains the four metrics.
242
+
243
+ For Android, declare steps, distance, total calories, sleep, exercise, and optional
244
+ history access in the host app's Google Play Health Apps form. Use the merged
245
+ manifest to verify the permission list. See [Google Play's Health Connect publishing guide](https://developer.android.com/health-and-fitness/health-connect/publish).
246
+
247
+ To start the Android connection flow, send:
248
+
249
+ ```javascript
250
+ window.ReactNativeWebView.postMessage(
251
+ JSON.stringify({ method: 'CONNECT_TO_GOOGLE_FIT' })
252
+ );
253
+ ```
67
254
 
68
- Android host apps must declare both foreground location permissions:
255
+ The native SDK requests Health Connect permissions or opens its Play Store page
256
+ if installation or an update is required. Send the same message again after
257
+ returning from the store. The PWA can request the current state with
258
+ `GET_HEALTH_CONNECT_STATUS`. The native bridge reports `NOT_SUPPORTED`,
259
+ `NOT_INSTALLED`, `INSTALLED`, or `CONNECTED`.
69
260
 
70
- ```xml
71
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
72
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
73
- ```
261
+ Both platforms accept `GET_DATA_TO_GENERATE_GRAPH` for steps, calories, and
262
+ distance by day, week, and month, and for sleep by day and week. The SDK
263
+ delivers the existing `DetailedGraph` callbacks and supplies steps and sleep
264
+ minutes to `updateFitnessPermissions` on connection.
74
265
 
75
- When the web application sends `GET_LOCATION_PERMISSIONS`, the SDK checks for
76
- fine-location access. It requests fine location through the normal Android
77
- runtime permission dialog when possible. If permission is blocked, the SDK
78
- offers to open the app's settings page.
266
+ ### **7.0.0**
79
267
 
80
- After permission is granted, the SDK checks the phone's Location Services
81
- setting. It never displays an in-app GPS enable prompt; instead, it offers to
82
- open the phone's Location settings. When the user returns, the SDK rechecks
83
- both states and calls the existing web callback:
268
+ * Restore steps, calories, distance, and sleep on Android and iOS.
269
+ * Use AndroidSDK `v7.0.0` and start the native Health Connect permission flow directly.
270
+ * Remove the Android PWA disclaimer callback.
84
271
 
85
- ```js
86
- window.checkTheGpsPermission(true); // Fine location and Location Services enabled
87
- window.checkTheGpsPermission(false); // Either requirement is unavailable
88
- ```
272
+ ### **3.0.15**
89
273
 
90
- Approximate/coarse-only location access is not sufficient. The iOS behavior is
91
- unchanged and continues to report `true` for `GET_LOCATION_PERMISSIONS`.
274
+ * Detect when iOS step-read access is unavailable after the HealthKit authorization sheet has already been answered.
275
+ * Show recovery instructions when HealthKit access is denied and offer to open the Health settings page.
276
+ * Refresh the PWA's HealthKit permission state when the iOS app returns to the foreground.
92
277
 
93
- ## Dependency and event migration
278
+ ### **3.0.14**
94
279
 
95
- `react-native-event-listeners` and
96
- `@visit-health/react-native-location-enabler` are no longer used by the SDK.
97
- Remove them from the host app if nothing else requires them, and install the
98
- `react-native-permissions` peer dependency shown above.
280
+ * Request read-only HealthKit access for step data on iOS without requesting write permission.
281
+ * Determine HealthKit connection status without writing and deleting a probe step sample.
282
+ * Keep the existing JavaScript APIs and callback signatures unchanged.
99
283
 
100
- The SDK no longer emits the global `visit-event`. In particular,
101
- `OPEN_FACE_SCAN_FLOW` and WebView errors are no longer forwarded through a
102
- global event emitter, and the example app's unused
103
- `unauthorized-wellness-access` listener has been removed. WebView errors are
104
- logged only when `isLoggingEnabled={true}`.
284
+ ### **3.0.13**
105
285
 
106
- ## Migrating to 6.0.1
286
+ * Add iOS compatibility methods for `getTodaySleepMinutes()` and `getTodayCalorieCount()` that resolve to `0`.
287
+ * Keep the existing JavaScript APIs and callback signatures unchanged.
107
288
 
108
- Pass the pre-generated SSO URL through `ssoLink`. This is the only URL prop in
109
- `6.0.1`; `isLoggingEnabled` remains optional and defaults to `false`.
289
+ ### **3.0.12**
110
290
 
111
- ## Migrating to 6.0.0
291
+ * Rely on the PWA's `GET_HEALTH_CONNECT_STATUS` request instead of automatically refreshing Health Connect status whenever the Android app returns to the foreground.
112
292
 
113
- Apple Health and Health Connect functionality has been removed in `6.0.0`.
114
- Host apps no longer need to add HealthKit entitlements, HealthKit usage
115
- descriptions, Health Connect permissions, or Health Connect rationale screens
116
- for this package.
293
+ ### **3.0.11**
117
294
 
118
- `VisitRnSdkView` accepts only a pre-generated `ssoLink` plus the optional
119
- `isLoggingEnabled` flag. The SDK no longer accepts `cpsid`, `baseUrl`,
120
- `errorBaseUrl`, `token`, `moduleName`, or `environment`, and it no longer
121
- generates magic links internally.
295
+ * Upgrade AndroidSDK to `v3.13`.
296
+ * Reconcile hourly step buckets with Health Connect's exact daily aggregate so the graph total matches the daily total despite hourly fractional-step truncation.
297
+ * Keep the existing React Native APIs and PWA callback signatures unchanged.
122
298
 
123
- ### Video Calling
299
+ ### **3.0.10**
124
300
 
125
- `react-native-visit-rn-sdk` declares [`@twilio/video-react-native-sdk`](https://www.npmjs.com/package/@twilio/video-react-native-sdk) as a **peer dependency**. Install the matching version in your app:
301
+ * Upgrade AndroidSDK to `v3.12`.
302
+ * Keep the existing React Native APIs and PWA callbacks unchanged while Android returns compatibility zero values for removed calorie, distance, and sleep Health Connect data.
126
303
 
127
- ```sh
128
- npm install @twilio/video-react-native-sdk@3.5.0 --legacy-peer-deps
129
- ```
304
+ ### **3.0.9**
130
305
 
131
- Required native permissions in the host app:
306
+ * Check Health Connect installation status before native step capability.
307
+ * Route `NOT_INSTALLED` directly to the native install/permission flow instead of the PWA disclaimer.
308
+ * Route Health Connect status-check failures to the permission flow.
309
+ * Keep capability-check failures on the PWA disclaimer fallback.
132
310
 
133
- - Android (`AndroidManifest.xml`)
311
+ ### **3.0.8**
134
312
 
135
- ```xml
136
- <uses-permission android:name="android.permission.CAMERA" />
137
- <uses-permission android:name="android.permission.RECORD_AUDIO" />
138
- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
139
- ```
313
+ * Remove duplicate-request suppression so the PWA can restart the flow after the user returns from the Health Connect Play Store page.
140
314
 
141
- - iOS (`Info.plist`)
315
+ ### **3.0.7**
142
316
 
143
- ```xml
144
- <key>NSCameraUsageDescription</key>
145
- <string>Visit needs camera access for video consultations.</string>
146
- <key>NSMicrophoneUsageDescription</key>
147
- <string>Visit needs microphone access for video consultations.</string>
148
- ```
317
+ * Add Android native step-tracking capability detection through AndroidSDK `v3.11`.
318
+ * Add the `window.showHealthConnectDisclaimer()` PWA callback and strict `disclaimerAccepted: true` continuation contract.
319
+ * Add Health Connect routing logs for supported, unsupported, and failed capability checks.
149
320
 
150
- Proguard Rules (Android)
321
+ ### **Sample Project**
151
322
 
152
- ```pro
153
- # Twilio Video SDK
154
- -keep class com.twilio.** { *; }
323
+ Please use the below project which demonstrates how to use the SDK. `https://github.com/VisitApp/Visit-ReactNative/tree/mchi-rn-sdk-3x/example`
155
324
 
156
- # Twilio-packaged WebRTC classes
157
- -keep class tvi.webrtc.** { *; }
325
+ **Permission Usage Declaration:**
158
326
 
159
- # Optional: reduce warning noise
160
- -dontwarn tvi.webrtc.**
161
- -dontwarn com.twilio.**
162
- ```
327
+ 1\. For android, Google needs the declaration of how you are using the Health Data in your organisation privacy policy webpage.
328
+ Description for this is present inside this document along with the permission that needs to be added in the Google Play Console
329
+ <custom data-type="smartlink" data-id="id-0">https://docs.google.com/document/d/1QKtC9ofRtrLIroBzW0pG7BrdrpG_KorHbM5Y0zcgGQI/edit?usp=sharing</custom>
330
+
163
331
 
164
- ## Contributing
332
+ 2. For iOS, Health and Fitness permission needs to be added in the App Store Connect Dashboard.
165
333
 
166
- See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
334
+ ![](blob:https://media.staging.atl-paas.net/?type=file&localId=d0ec2b9a9fa8&id=e6019c8d-ca4b-4cae-bbae-9434437759ca&&collection=contentId-2202599425&height=523&occurrenceKey=null&width=1181&__contextId=null&__displayType=null&__external=false&__fileMimeType=null&__fileName=null&__fileSize=null&__mediaTraceId=null&url=null)
167
335
 
168
- ## License
336
+
169
337
 
170
- MIT
171
338
 
172
- ---
173
339
 
174
- Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
340
+ ‌
@@ -101,7 +101,10 @@ dependencies {
101
101
  //noinspection GradleDynamicVersion
102
102
  implementation "com.facebook.react:react-native:+"
103
103
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
104
- implementation "androidx.appcompat:appcompat:1.7.1"
104
+ implementation "com.github.VisitApp:AndroidSDK:v7.0.0"
105
+ implementation "androidx.health.connect:connect-client:1.1.0"
106
+ implementation "com.jakewharton.timber:timber:5.0.1"
107
+ implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1"
105
108
  }
106
109
 
107
110
  if (isNewArchitectureEnabled()) {
@@ -1,5 +1,5 @@
1
- VisitRnSdk_kotlinVersion=1.7.0
2
- VisitRnSdk_minSdkVersion=21
3
- VisitRnSdk_targetSdkVersion=31
4
- VisitRnSdk_compileSdkVersion=31
1
+ VisitRnSdk_kotlinVersion=1.9.25
2
+ VisitRnSdk_minSdkVersion=23
3
+ VisitRnSdk_targetSdkVersion=35
4
+ VisitRnSdk_compileSdkVersion=36
5
5
  VisitRnSdk_ndkversion=21.4.7075529
@@ -1,8 +1,14 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- xmlns:tools="http://schemas.android.com/tools"
3
- package="com.visitrnsdk">
2
+ package="com.visitrnsdk">
4
3
 
5
- <uses-permission
6
- android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"
7
- tools:node="remove" />
4
+ <uses-permission android:name="android.permission.CAMERA" />
5
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
6
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
7
+
8
+ <uses-feature
9
+ android:name="android.hardware.camera"
10
+ android:required="false" />
11
+ <uses-feature
12
+ android:name="android.hardware.camera.front"
13
+ android:required="false" />
8
14
  </manifest>
@@ -1,7 +1,13 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- xmlns:tools="http://schemas.android.com/tools">
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
2
 
4
- <uses-permission
5
- android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"
6
- tools:node="remove" />
3
+ <uses-permission android:name="android.permission.CAMERA" />
4
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
5
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
6
+
7
+ <uses-feature
8
+ android:name="android.hardware.camera"
9
+ android:required="false" />
10
+ <uses-feature
11
+ android:name="android.hardware.camera.front"
12
+ android:required="false" />
7
13
  </manifest>