Skip to content

Commit

Permalink
RMET-3158 H&F Plugin - Open Health Connect App (#107)
Browse files Browse the repository at this point in the history
* feat: first implementation of androidCopyPreferencesPermissions hook

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: fix path to hook file

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: add dependency to xmldom

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* feat: implement first version of hook processing preferences

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* refactor: remove unnecessary code

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: fix comparator in condition

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* test: add log for troubleshooting

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* test: add log for troubleshooting

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* test: add log for troubleshooting

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: use "" instead of null in comparison

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* refactor: remove logs

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* refactor: remove logs and comments

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* feat: add permissions code for Android <= 13

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: fix variable name

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* feat: add background permissions to AndroidManifest.xml file

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: properly pass DOMParser to functions

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: fix condition in if for background job permissions

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* feat: remove unnecessary permissions

Context: The new version of the H&F plugin, which uses Health Connect, no longer needs these permissions by default.

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* test: add logs for troubleshooting

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: fix if condition

Context: We only want to not include the permissions if DisableBackgroundJobs is exactly equal to "true"

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* feat: copy notification content to strings.xml

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: fix query selector

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: properly look for string tags

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* test: add logs for troubleshooting

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* misc: add log for troubleshooting

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* misc: add logs for troubleshooting

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* feat: use different way of setting texts in strings.xml

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* refactor: remove logs and comments

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: replace const with var

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* feat: add PermissionsRationaleActivity to AndroidManifest.xml

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* feat: also use default value for notificationDescription

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: add missing permissions for background jobs

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* chore: update changelog

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* refactor: use correct english term

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: include necessary dependencies

Context: Because dependencies from our Health and Fitness Android library are not being transitive, we need to include them in the plugin's build.gradle file so that they're included in the app's build gradle.

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* fix: include dependencies for Jetpack Compose in build.gradle

References: https://outsystemsrd.atlassian.net/browse/RMET-3142

* feat: implement openHealthConnect

References: https://outsystemsrd.atlassian.net/browse/RMET-3158

* chore: update changelog

References: https://outsystemsrd.atlassian.net/browse/RMET-3158

* chore: update dependency version

References: https://outsystemsrd.atlassian.net/browse/RMET-3158

* chore: remove code from other branch

References: https://outsystemsrd.atlassian.net/browse/RMET-3158

* chore: remove changes from other branch

References: https://outsystemsrd.atlassian.net/browse/RMET-3158

* refactor: fix spacing

References: https://outsystemsrd.atlassian.net/browse/RMET-3158
  • Loading branch information
alexgerardojacinto committed Apr 9, 2024
1 parent 270597f commit 5211a78
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ The changes documented here do not include those from the original repository.

## [Unreleased]

## 2024-02-28
- Implemented `Open Health Connect App` (https://outsystemsrd.atlassian.net/browse/RMET-3158).

## 2024-02-26
- Implemented `Show app's privacy policy dialog` (https://outsystemsrd.atlassian.net/browse/RMET-3145).

Expand Down
2 changes: 1 addition & 1 deletion src/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies{

implementation("com.github.outsystems:oscore-android:1.2.0@aar")
implementation("com.github.outsystems:oscordova-android:1.2.0@aar")
implementation("com.github.outsystems:oshealthfitness-android:1.2.0.18@aar")
implementation("com.github.outsystems:oshealthfitness-android:1.2.0.19@aar")
implementation("com.github.outsystems:osnotificationpermissions-android:0.0.4@aar")

def roomVersion = "2.4.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ class OSHealthFitness : CordovaImplementation() {
"disconnectFromGoogleFit" -> {
disconnectFromGoogleFit()
}
"openHealthConnect" -> {
openHealthConnect()
}
}
return true
}
Expand Down Expand Up @@ -299,6 +302,18 @@ class OSHealthFitness : CordovaImplementation() {
)
}

private fun openHealthConnect() {
healthConnectViewModel.openHealthConnect(
getContext(),
{
sendPluginResult("success", null)
},
{
sendPluginResult(null, Pair(it.code.toString(), it.message))
}
)
}

override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent) {
super.onActivityResult(requestCode, resultCode, intent)
healthConnectViewModel.handleActivityResult(requestCode, resultCode, intent,
Expand Down
4 changes: 4 additions & 0 deletions www/OSHealthFitness.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ exports.updateBackgroundJob = function (success, error, params) {
exports.disconnectFromGoogleFit = function (success, error) {
exec(success, error, 'OSHealthFitness', 'disconnectFromGoogleFit');
};

exports.openHealthConnect = function (success, error) {
exec(success, error, 'OSHealthFitness', 'openHealthConnect');
};

0 comments on commit 5211a78

Please sign in to comment.