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

RMET-3070 H&F Plugin - Implement disableHealthConnect feature and Deprecate disableGoogleFit #102

Merged
merged 5 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ The changes documented here do not include those from the original repository.
- Re-implement `DeleteBackgroundJob` feature (https://outsystemsrd.atlassian.net/browse/RMET-3068).

## 2024-02-20
- Deprecated `DisableGoogleFit` feature and implemented `DisableHealthConnect` feature (https://outsystemsrd.atlassian.net/browse/RMET-3070).
- Re-implemented UpdateBackgroundJob feature (https://outsystemsrd.atlassian.net/browse/RMET-3067).
- Re-implemented SetBackgroundJob feature (https://outsystemsrd.atlassian.net/browse/RMET-3050).


## 2024-02-09
- Re-implemented AdvanceQuery feature (https://outsystemsrd.atlassian.net/browse/RMET-3047).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ class OSHealthFitness : CordovaImplementation() {
"disconnectFromGoogleFit" -> {
disconnectFromGoogleFit()
}
"disconnectFromHealthConnect" -> {
disconnectFromHealthConnect()
}
"openHealthConnect" -> {
openHealthConnect()
}
Expand Down Expand Up @@ -291,6 +294,13 @@ class OSHealthFitness : CordovaImplementation() {
)
}

@Deprecated(
message = "The Google Fit Android API is deprecated. " +
"To fully disconnect from the legacy Google Fit integration, " +
"please visit your Google Account settings and " +
"revoke the OAuth token associated with the app.",
replaceWith = ReplaceWith("disconnectFromHealthConnect()")
)
private fun disconnectFromGoogleFit() {
healthStore?.disconnectFromGoogleFit(
{
Expand All @@ -302,6 +312,18 @@ class OSHealthFitness : CordovaImplementation() {
)
}

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

private fun openHealthConnect() {
healthConnectViewModel.openHealthConnect(
getContext(),
Expand Down
4 changes: 4 additions & 0 deletions www/OSHealthFitness.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ exports.disconnectFromGoogleFit = function (success, error) {
exec(success, error, 'OSHealthFitness', 'disconnectFromGoogleFit');
};

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

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