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

HealthConnect.requestHealthPermissions(...) fails with "Can request only one set of permissions at a time" error. #18

Open
T-Ralph opened this issue Aug 19, 2024 · 0 comments

Comments

@T-Ralph
Copy link
Contributor

T-Ralph commented Aug 19, 2024

HealthConnect.requestHealthPermissions(...) fails with Logcat error:

Activity  ... W  Can request only one set of permissions at a time

Environment:
"@angular/core": "^18.0.0",
"@ionic/angular": "^8.0.0",
"@capacitor/android": "6.1.0",
"@capacitor/app": "6.0.0",
"capacitor-health-connect": "^0.6.0",

Android Studio: Koala
Android Emulator: Pixel 8 Pro API 35

Test:
Requesting one or more permissions with either read and/or write access.

Ideas:

  • Health Connect requires all permissions to be requested at once (all together), not sequentially.
  • It is currently unclear how startActivityForResult(call, intent, "handleRequestPermission") in HealthConnectPlugin.requestHealthPermissions(call: PluginCall) sends the permission requests.
  • Potentially, triggering permissions with registerForActivityResult().launch() and without Capacitor might be helpful.

Resource:

Workaround:
Use HealthConnect.openHealthConnectSetting() to open Health Connect so the user can select the required permissions.

@yukukotani Please, take a look.
Thank you.

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

No branches or pull requests

1 participant