Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capacitor Healthkit fixes #1765

Open
wants to merge 84 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
0450c86
fix(healthkit): Initial changes to only store poll times in cache and…
mpgxvii Mar 8, 2024
a8e5dd4
Refactor healthkit converter so that data is pulled after the questio…
mpgxvii Mar 18, 2024
d3a5288
Merge branch 'dev' of https://github.com/RADAR-base/RADAR-Questionnai…
mpgxvii Mar 19, 2024
48e56fa
fix: remove hardcoded datatypes and pull healthkit topics from enums
mpgxvii Mar 19, 2024
3f3592d
fix: update Healthkit topics
mpgxvii Mar 19, 2024
12ee55b
fix: cleanup and fix tests
mpgxvii Mar 19, 2024
2b0de26
fix: default config
mpgxvii Mar 19, 2024
29eba8a
fix: add slide transition check before processing data
mpgxvii Apr 1, 2024
bbee8a9
fix: add healthkit lookback interval to remote config
mpgxvii Apr 2, 2024
be64063
fix: chunk healthkit data into batches to be within gateway limit
mpgxvii Apr 2, 2024
580ad8c
feat: add initial finish screen loading animation
mpgxvii Apr 2, 2024
42b0b11
fix: progress bar animation
mpgxvii Apr 3, 2024
f6c6578
fix: permissions
mpgxvii Apr 4, 2024
488d317
fix: update deps and Android config
mpgxvii Apr 22, 2024
5fe7c54
chore: update package-lock.json
mpgxvii Apr 22, 2024
8ed63f1
fix: use multipleQueryHKitSampleType to query multiple data types in …
mpgxvii Apr 22, 2024
b985b6d
fix: merge conflicts
mpgxvii Apr 22, 2024
c87d1c0
fix: qr code enrolment and remove smoothscroll polyfill
mpgxvii Apr 22, 2024
be74ffd
chore: update deps for unit tests
mpgxvii Apr 22, 2024
2e2b022
fix(kafkaService): chunk records to smaller records if it exceeds max…
mpgxvii Apr 22, 2024
c075d52
fix: divide healthkit queries by batches
mpgxvii Apr 22, 2024
01ab0d1
fix: send progress data from kafka service to questions page
mpgxvii Apr 29, 2024
74705c0
fix: fix calculation of progress and show this in the component
mpgxvii Apr 30, 2024
60287fa
Merge branch 'dev' of https://github.com/RADAR-base/RADAR-Questionnai…
mpgxvii Apr 30, 2024
0f778a2
fix: app naming
mpgxvii Apr 30, 2024
f668788
fix: icon and Info.plist
mpgxvii Apr 30, 2024
7593c98
fix: revert kafka service to previous version
mpgxvii May 2, 2024
01cf353
fix: merge conflicts
mpgxvii May 7, 2024
6a88090
fix(storage): remove separate global storage and use storageService
mpgxvii May 8, 2024
7bc3020
fix: names and deps
mpgxvii May 8, 2024
ad02da6
fix: kafka service and converters to send records as they are processed
mpgxvii May 8, 2024
a33b2ec
fix: tests
mpgxvii May 8, 2024
b9d13a7
fix: hk steps permission
mpgxvii May 9, 2024
d279874
fix: add separate questionnaireprocessor services for health and fix …
mpgxvii May 10, 2024
0e01c6b
fix: use uuid for cachekey and minor cleanup
mpgxvii May 13, 2024
b966d7f
fix(healthInput): move requesting of permissions and loading data whe…
mpgxvii May 13, 2024
51a4407
fix: change finish button text to 'Please wait'
mpgxvii May 14, 2024
b6b5d26
fix: uncomment getting of healthkit last poll time
mpgxvii May 14, 2024
f4d7edd
fix: appserver url
mpgxvii May 14, 2024
7c071bf
fix: remove test fcm token
mpgxvii May 14, 2024
bbe7ee0
fix: merge conflicts
mpgxvii May 14, 2024
a291180
fix(healthkit): display progress in finish page and skip hk question …
mpgxvii May 17, 2024
a563aa1
fix: add eta to finish page
mpgxvii May 31, 2024
cc391c1
fix: finish page eta text
mpgxvii Jun 10, 2024
2e5af70
Merge pull request #1802 from RADAR-base/fix/hk-ui
mpgxvii Jun 10, 2024
702cdff
Add ETA text fixes and update healthkit lookback to 1000 days by default
mpgxvii Nov 7, 2024
db30c55
Update healthkit default lookback interval
mpgxvii Nov 7, 2024
fb7bf83
Update Healthkit lookback interval default value
mpgxvii Nov 8, 2024
4088bb9
Add support for reference timestamp when pulling HK data
mpgxvii Nov 11, 2024
f36a838
Replace source name value with device info
mpgxvii Nov 11, 2024
9b6d9ce
Fix merge conflicts
mpgxvii Nov 12, 2024
4a70069
Update package-lock.json
mpgxvii Nov 12, 2024
c6e0ee7
Fix node version
mpgxvii Nov 12, 2024
f4a6c49
Merge branch 'dev' of https://github.com/RADAR-base/RADAR-Questionnai…
mpgxvii Dec 3, 2024
5ae5488
Add back questionnaire processing on completion
mpgxvii Dec 4, 2024
e1938ee
Merge branch 'master' of https://github.com/RADAR-base/RADAR-Question…
mpgxvii Dec 6, 2024
57ab655
Decode iat in token if not present in response
mpgxvii Dec 6, 2024
09c4ba3
Fix settings page
mpgxvii Dec 6, 2024
4d25822
Use capacitor http for kafka requests
mpgxvii Dec 10, 2024
422e698
Fix progress updating
mpgxvii Dec 10, 2024
5e9071d
Add additional healthkit data types
mpgxvii Dec 10, 2024
1e83472
Add reset for schemas and converters
mpgxvii Dec 11, 2024
f47dd25
Update healthkit converter to support unknown device info
mpgxvii Dec 12, 2024
c40f3ba
Fix kafka service to support sending of large paylods
mpgxvii Dec 13, 2024
2b2ba1f
Calculate minutes for sending estimated time
mpgxvii Dec 16, 2024
1b958f2
Add Healthkitconverter webworker to run conversion outside main thread
mpgxvii Dec 16, 2024
025b98f
Update schedule year coverage
mpgxvii Dec 18, 2024
88a8e3e
Merge branch 'dev' of https://github.com/RADAR-base/RADAR-Questionnai…
mpgxvii Jan 9, 2025
e5ad8a7
Fix package-lock.json
mpgxvii Jan 9, 2025
b1ed730
Remove unnecessary topic param in converterService
mpgxvii Jan 9, 2025
71e9466
Fix healthkit sourcename delimiter
mpgxvii Jan 9, 2025
6827fcb
Fix date input parsing
mpgxvii Jan 9, 2025
6942339
Update checking if healthkit input type
mpgxvii Jan 9, 2025
b9a4d74
Update onResume to only refresh screen when on the HomePage
mpgxvii Jan 9, 2025
1ab2e85
Use hash key instead of uuid for cache key
mpgxvii Jan 9, 2025
a1617cd
Fix package-lock.json
mpgxvii Jan 9, 2025
d6cf5ac
Remove unnecessary topic parameter in kafka converters
mpgxvii Jan 9, 2025
6dd04c2
Add custom test polyfills
mpgxvii Jan 9, 2025
23d02b1
Rename test polyfills
mpgxvii Jan 9, 2025
58d26e2
Use library for hashing instead of crypto
mpgxvii Jan 9, 2025
9c15e7f
Update README with Healthkit docs
mpgxvii Jan 9, 2025
317082c
Update README
mpgxvii Jan 9, 2025
9967d8e
Request Healthkit permissions based on datatype
mpgxvii Jan 9, 2025
aa2a798
Add KeyConverter abstract class
mpgxvii Jan 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
33 changes: 23 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ $ANDROID_HOME/build-tools/27.0.2/zipalign -v 4 <your-project-path>/platforms/and

## Questionnaire Input Types

The questionnaire input types supported are `audio`, `checkbox`, `descriptive`, `info-screen`, `matrix-radio`, `radio`, `range-info`, `range-input`, `slider`, `text`, `date`, `time`, and `timed-test`.
The questionnaire input types supported are `audio`, `checkbox`, `descriptive`, `info-screen`, `matrix-radio`, `radio`, `range-info`, `range-input`, `slider`, `text`, `date`, `time`, `healthkit`, and `timed-test`.

### Descriptive Input Type

Expand Down Expand Up @@ -297,17 +297,30 @@ Here is the output:

<img src="/.github/etc/descriptive-2.png" width="200px"><img src="/.github/etc/descriptive-1.png" width="200px">

## Common Errors
## Healthkit Input Type

Here are some common errors you might find during installation.
Please see `/src/app/shared/models/health.ts` for a list of supported data types. In order to add support for new data types, follow the steps below:

### Error: cordova-custom-config
### Add the New Data Type to `HealthkitDataType`

When you are running `ionic cordova run ios`, you might encounter the problem, we solved this problem by refering this [issue](https://github.com/dpa99c/cordova-custom-config/issues/144) with `cordova-custom-config`.
Open the `health.ts` file and add the new data type to the `HealthkitDataType` enum. Use a descriptive key and a string value that matches the Healthkit data type.

We enter the following command at the root directory.

```
cd plugins/cordova-custom-config
npm install
```typescript
export enum HealthkitDataType {
...
VO2_MAX = 'vo2Max',
}
```

### Add a New Permission to HealthkitPermission
Add the corresponding permission to the `HealthkitPermission` enum. The permission should match the new data type.

### Map the Data Type to Its Permission
Update the `HealthkitPermissionMap` object to link the new `HealthkitDataType` to its `HealthkitPermission`.

### Add the Kafka Topic to HealthkitTopic
Add the corresponding topic to the `HealthkitTopic` enum. The topic should be a descriptive string representing the data type's usage in your system.

### Add to the Appropriate Data Type Sets (if applicable)
Depending on the data type (e.g., numeric or string), add the new data type to the relevant set: `HealthkitFloatDataTypes` or `HealthkitStringDataTypes`.

1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
android:hardwareAccelerated="true">

<meta-data
Expand Down
1 change: 0 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
}
],
"styles": ["src/theme/variables.scss", "src/global.scss"],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
Expand Down
6 changes: 5 additions & 1 deletion capacitor.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const config: CapacitorConfig = {
appName: 'RADAR Active RMT',
webDir: 'www',
server: {
androidScheme: 'https'
androidScheme: 'https',
"cleartext": true
},
loggingBehavior: 'none',
plugins: {
Expand All @@ -26,6 +27,9 @@ const config: CapacitorConfig = {
},
FirebaseMessaging: {
presentationOptions: ['badge', 'sound', 'alert']
},
CapacitorHttp: {
enabled: true
}
},
cordova: {
Expand Down
5 changes: 5 additions & 0 deletions ios/App/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,10 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
Loading
Loading