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

[health] Add getHealthConnectSdkStatus #941

Conversation

ciriousjoker
Copy link
Contributor

@ciriousjoker ciriousjoker commented Apr 2, 2024

@ciriousjoker ciriousjoker changed the title Add getHealthConnectStatus [health] Add getHealthConnectStatus Apr 2, 2024
@ciriousjoker ciriousjoker force-pushed the health_getHealthConnectStatus branch from 57a132e to f096bd4 Compare April 2, 2024 15:08
@ciriousjoker ciriousjoker changed the title [health] Add getHealthConnectStatus [health] Add getHealthConnectSdkStatus Apr 2, 2024
@ciriousjoker ciriousjoker force-pushed the health_getHealthConnectStatus branch 2 times, most recently from ffc27af to 82edf4d Compare April 2, 2024 15:55
@ciriousjoker ciriousjoker force-pushed the health_getHealthConnectStatus branch from 82edf4d to ddbb06d Compare April 2, 2024 16:25
requestPermissionActivityContract
) { granted -> onHealthConnectPermissionCallback(granted) }
}
healthConnectRequestPermissionsLauncher =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to always be done now since doing it later (after the user installed Health Connect) is no longer possible.

@@ -2449,6 +2448,17 @@ class HealthPlugin(private var channel: MethodChannel? = null) :
result.success(null)
}

private fun getHealthConnectSdkStatus(call: MethodCall, result: Result) {
checkAvailability()
if (healthConnectAvailable) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Availability could have changed since the sdk was set up, so we need to make sure the client exists in those cases or the other methods will crash.

@bardram bardram changed the base branch from master to bardram/health-update April 3, 2024 08:16
@bardram bardram merged commit 34f41d9 into cph-cachet:bardram/health-update Apr 3, 2024
1 check passed
bardram added a commit that referenced this pull request Apr 3, 2024
@bardram bardram mentioned this pull request Apr 3, 2024
@bardram
Copy link
Contributor

bardram commented Apr 3, 2024

This has now been released in 10.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants