I'm a developer on a fitness app that is trying to integrate with Health Connect, I followed all the API specs and got it working on my test phones, and if I install it on my phone via the Internal Testing channel on Google Play. It works great. However, when we distributed the app to our testers via Closed Testing channel on Google Play, they get the following message:
This app can't access Health Connect
Error they see on the phone
They updated the app, as instructed. They all have Health Connect (Beta) installed, but when trying to ask for permissions inside our app, they get the error.
What other permissions do published apps need in order to make this work? Thank you,
The way app accesses the client:
private val requestPermissions =
registerForActivityResult(requestPermissionActivityContract) { granted ->
updatePermissionsList(granted)
}
...
viewLifecycleOwner.lifecycleScope.launchWhenStarted {
val granted =
HealthConnectClient.getOrCreate(requireContext())
.permissionController
.getGrantedPermissions(CoPilotHealthConnectApi.PERMISSIONS)
if (granted.containsAll(CoPilotHealthConnectApi.PERMISSIONS)) {
val intent =
requireContext()
.packageManager
.getLaunchIntentForPackage("com.google.android.apps.healthdata")
context?.startActivity(intent)
} else {
requestPermissions.launch(CoPilotHealthConnectApi.PERMISSIONS)
}
...
Build file:
minSdk 28
targetSdk 33
Tried:
Expecting:
Apps currently need to be allowlisted to get access to Health Connect. You can follow the process outlined at: https://developer.android.com/guide/health-and-fitness/health-connect/frequently-asked-questions#q_how_do_i_request_access_to_readwrite_data_types