-
Notifications
You must be signed in to change notification settings - Fork 297
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
Authorization status #69
Authorization status #69
Conversation
Add bridge method for HKHealthStore.authorizationStatusForType to be able to determine if user actually granted certain write permission. See: https://developer.apple.com/documentation/healthkit/hkhealthstore/1614154-authorizationstatusfortype?language=objc
Fixes #68 |
@terrillo ping |
Or @EJohnF @JulianKingman please have a look. Only now, I see there is a different authorization status implementation available in #41 as well. I'm happy to have either one merged. If the other one is preferred, then I'd still like to include the exception handling changes from this one. |
I see that you want to remove NSLogs and make promisified check for authorisations status. |
@EJohnF I’m confused about your comment.
Please accept this PR. |
how to use this? what are the params for authorizationStatusForType(...)? |
Sorry, I forget that Can you add docs pls? And then I'll remove duplicated function from my PR and merge everything |
@EJohnF thanks, I've added some documentation now! |
hm, in code you are using promises, but in docs callback? |
@adbl ping |
Right, sorry for the delay! I’ll try to fix this within a few days |
@EJohnF I see that the docs I wrote are wrong (copy/paste 😅), I can gladly fix the docs, but changing the code is not likely to happen any time soon I'm afraid. Can the PR be accepted as it is if I change the docs? |
…spbordignon#69" This reverts commit 181f4fa.
* upstream/master: (55 commits) removing checkpermission Update getBloodGlucoseSamples().md feat: add source id and name to fetchQuantitySamplesOfType func add docs for getBodyFatPercentageSamples and getLeanBodyMassSamples update docs according actual implementation docs adding a flag includeManuallyAdded add getLeanBodyMassSamples and getBodyFatPercentageSamples add saveLeanBodyMass add saveBodyFatPercentage Update README.md 0.6.5 Fix doc example Add documentation for authorizationStatusForType remove checkPermission functions in order to use from PR lucaspbordignon#69 change back default to imperial system, add activity name field, fix docs fix typo update docs, change one of the returning key from getSamples adding period for all adding swimming persmission and method ...
Is this released? |
Adds bridge method
authorizationStatusForType
in order for JS code to detect if the app has a certain permission.Also changes all NSError situations to preserve the native error information over to the JS side, using
RCTJSErrorFromNSError
instead of making a new error object. RemoveNSLog
because I didn't see any reason to log all of these expected situations, and with the full error information that can be done from JS side, if desired.