79249914

Date: 2024-12-04 04:50:37
Score: 0.5
Natty:
Report link

According to the documentation, there is no callback for when a user denies the Health Connect permission twice. We need to display a custom button that redirects the user to the Health Connect settings.

val requestPermissions =
        registerForActivityResult(requestPermissionActivityContract) { granted -> 
            mViewModel.checkHealthConnectPermissions(
                grantedPermissions = granted
            )

            //Update Permission Request Count
            if (granted.isEmpty()) {
              ShowCustomButton()
            }
        }
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Sudheer Karna