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

Authorization status #69

Merged
merged 7 commits into from Apr 29, 2019

Conversation

adbl
Copy link
Contributor

@adbl adbl commented Dec 13, 2018

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. Remove NSLog 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.

@adbl
Copy link
Contributor Author

adbl commented Dec 13, 2018

Fixes #68

@adbl
Copy link
Contributor Author

adbl commented Dec 19, 2018

@terrillo ping

@adbl
Copy link
Contributor Author

adbl commented Dec 29, 2018

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.

@EJohnF
Copy link
Contributor

EJohnF commented Feb 5, 2019

I see that you want to remove NSLogs and make promisified check for authorisations status.
As we know, there is not way to check read permisstions.
And for write(=share) permissions there is checkSharePermission function.

@adbl
Copy link
Contributor Author

adbl commented Feb 5, 2019

@EJohnF I’m confused about your comment.

  1. I’ve changed error handling so that the real exception information is sent over to JS.
  2. Hence, there is no need for NSLog.
  3. Implemented bridge method to query share permission, I don’t see any checkSharePermission method in this library.

Please accept this PR.

@ganesh-papola
Copy link

how to use this?

what are the params for authorizationStatusForType(...)?

@EJohnF
Copy link
Contributor

EJohnF commented Feb 26, 2019

Sorry, I forget that checkPermission is in another PR, not in the lib at the moment
https://github.com/terrillo/rn-apple-healthkit/blob/3f9198745b79662558f7a29b09fffb69c0eb0dbc/RCTAppleHealthKit/RCTAppleHealthKit.m#L289

Can you add docs pls? And then I'll remove duplicated function from my PR and merge everything

EJohnF added a commit to EJohnF/rn-apple-healthkit that referenced this pull request Feb 26, 2019
@adbl
Copy link
Contributor Author

adbl commented Feb 28, 2019

@EJohnF thanks, I've added some documentation now!

@EJohnF
Copy link
Contributor

EJohnF commented Mar 1, 2019

hm, in code you are using promises, but in docs callback?
May be change code also to callback - in order to keep uniformity with the other functions?

@EJohnF
Copy link
Contributor

EJohnF commented Mar 9, 2019

@adbl ping

@adbl
Copy link
Contributor Author

adbl commented Mar 9, 2019

Right, sorry for the delay! I’ll try to fix this within a few days

@adbl
Copy link
Contributor Author

adbl commented Mar 20, 2019

@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?

adamivancza added a commit to adamivancza/rn-apple-healthkit that referenced this pull request Mar 22, 2019
@EJohnF EJohnF merged commit 581a982 into lucaspbordignon:master Apr 29, 2019
rfader added a commit to rfader/rn-apple-healthkit that referenced this pull request May 29, 2019
* 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
  ...
@marioot
Copy link

marioot commented Jul 12, 2019

Is this released?

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

Successfully merging this pull request may close these issues.

None yet

4 participants