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

revokeAllPermissions in not work on Android #104

Open
CohesionJamesTsao opened this issue Jun 12, 2024 · 7 comments
Open

revokeAllPermissions in not work on Android #104

CohesionJamesTsao opened this issue Jun 12, 2024 · 7 comments

Comments

@CohesionJamesTsao
Copy link

CohesionJamesTsao commented Jun 12, 2024

I followed all the settings in the document and other functions can be used normally.
But only the revokeAllPermissions function has no effect in Android 14
But in Android 13, it has normal removal permissions.

Environment:

  • Health Connect Version: 2.0.3
  • React Native Version: 0.71.16
  • New architecture enabled: Yes/No
  • Using Expo: No

import { initialize, requestPermission, getGrantedPermissions, readRecords, revokeAllPermissions, getSdkStatus, SdkAvailabilityStatus } from 'react-native-health-connect';

<TouchableOpacity style={styles.button} onPress={revokeAllPermissions}> <Text style={styles.text}>revokePermissions</Text> </TouchableOpacity>

@nestorLanex2
Copy link

nestorLanex2 commented Jun 20, 2024

I noticed this as well,
What happened on my end though is that when i close the app after revoking app permissions,
the permissions on the health connect were revoked. but only after I closed the app

If i don't close the app (not only simply putting it on the background), the permission changes don't seem to reflect

@bwmannering
Copy link

Same here - couldn't get this function to work

@matinzd
Copy link
Owner

matinzd commented Jun 21, 2024

This function hasn't been changed for a while and it can be due to changes from Google. So, expect these behaviours in alpha version.
I will try to narrow down the issue when I find some time.

@matinzd
Copy link
Owner

matinzd commented Jun 29, 2024

Finally I got some time to check this out!

This can be related to permission delegate API not being fully compatible with RN. Can everyone verify closing and opening the app would show the changes?

@ugurakin1
Copy link
Contributor

ugurakin1 commented Aug 12, 2024

Same here - I don't get the changes applied even on app close/re-open.

EDIT: I've tried again today and now I was able to revoke permissions after app close/re-open. Did a wipe emulator/clean/sync/build maybe that impacted things.

EDIT x2: Tested again after regressing the set of permissions my app requests and the call works without app close/re-open. I'm highly suspicious that adding all the permissions the app needed, which is a lot of permissions, may have broken all kinds of things - including this. Initially, I was testing with just R|W Exercise permissions and everything was working well. All hell broke loose once I added more permissions. I'm going to focus on continuing with a limited set of permissions for now and slowly introduce new permissions later on. Will update if I find out more.

@BlocknBoom123
Copy link

Finally I got some time to check this out!

This can be related to permission delegate API not being fully compatible with RN. Can everyone verify closing and opening the app would show the changes?

Please let us know if revokePermissions works now or what we should do as I have to close the entire app and reopen it for permissions to be taken away. Thank you.

@TheWeeezel
Copy link

It still does persist. Have to close and restart the app.

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

No branches or pull requests

7 participants