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

iOS: isAuthorized does not work #88

Open
m-ruhl opened this issue Dec 1, 2020 · 4 comments
Open

iOS: isAuthorized does not work #88

m-ruhl opened this issue Dec 1, 2020 · 4 comments

Comments

@m-ruhl
Copy link

m-ruhl commented Dec 1, 2020

Hello,

I was trying to see if the user, has given the app the permissions..

I think the wrong method is used:

[self.healthStore getRequestStatusForAuthorizationToShareTypes: sharePerms readTypes: readPerms completion:^(HKAuthorizationRequestStatus status, NSError *error) {

Because HKAuthorizationRequestStatus is compared against HKAuthorizationStatus
https://developer.apple.com/documentation/healthkit/hkauthorizationrequeststatus?language=objc

This method to my understanding only returns, if a popup will appear on requesting the permission, but won't tell if the app is authorised or not.

I think this method, is the right one https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatus
But as the documentation states.. it will only work on write not for read

Greets
Michael

@NguyenHoangMinhkkkk
Copy link

hello @m-ruhl, did you find any solution for this issue ?

@TheRogue76
Copy link

Having the same issue. Once the pop up is shown, the isAuthorized method will always return true even if the user has denied those permissions

@darrenmerrett
Copy link

This is in the docs...

Fitness.requestPermissions([{ kind: int, access: int }]) Ask permission and return if user granted or not(Android), while, due to Apple's privacy model, always true is returned in iOS.

@rlems
Copy link
Contributor

rlems commented Nov 15, 2021

Also check this issue with workaround: #50

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

5 participants