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

isAuthorized returns false always on Android < 14 #359

Open
ChandraKAV opened this issue Jan 20, 2025 · 3 comments
Open

isAuthorized returns false always on Android < 14 #359

ChandraKAV opened this issue Jan 20, 2025 · 3 comments

Comments

@ChandraKAV
Copy link

ChandraKAV commented Jan 20, 2025

on Android 13 and less, isAuthorized is returning false even when permissions are given on Google Fit. HealthConnect is installed and permissions are given.

private androidDataTypes = [
    'heart_rate',
    'steps',
    'blood_glucose',
    'height',
    'weight',
    'activity',
  ];

cordova.plugins.health.isAuthorized(
        {
          read: androidDataTypes  // Only checking for read access
        },
        (result: boolean) => resolve(result),
        (error: any) => reject(error)
      );

Permissions are given to our app in HealthConnect and Google Fit. HealthConnect has permissions in Google Fit. Still, plugin is returning false. Not sure if the implementation needs to be different on Android < 14.

BTW: On Android 14 it is working as expected and is returning data correctly.

Are we doing anything incorrectly ? Plugin is expected to recognise Android version and appropriately check the permissions , right?

@dariosalvi78
Copy link
Owner

it may be a bug in HealthConnect, especially if it seems to work correctly on Android >13.
I'd always try to get permissions even if already given, also because if already given the function will just return.

@ChandraKAV
Copy link
Author

I am checking for permissions always. we migrated from the earlier version of the plugin that worked with Google Fit to this version supporting HealthConnect. Resolved all problems while working with Google Fit as you are familiar.

is there a way to check / raise an issue with HealthConnect on this?

@dariosalvi78
Copy link
Owner

you can contact Google for bugs, sure, I guess they'd be happy to receive suggestions

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

2 participants