agencyenterprise / react-native-health

A React Native package to interact with Apple HealthKit
MIT License
797 stars 226 forks source link

Issue with initHealthkit #78

Open Shahulul opened 3 years ago

Shahulul commented 3 years ago

Describe the bug Sometimes when trying to call initHealthkit it gives a timeout error. I am calling initHealthkit in a button click. Error like this {"message": "Error with HealthKit authorization: Error Domain=com.apple.healthkit Code=100 \"Authorization session timed out\" UserInfo={NSLocalizedDescription=Authorization session timed out}"

To Reproduce Just try to call initHealthkit

Expected behavior Need to display the permission prompt

Smartphone (please complete the following information):

Additional context {"message": "Error with HealthKit authorization: Error Domain=com.apple.healthkit Code=100 \"Authorization session timed out\" UserInfo={NSLocalizedDescription=Authorization session timed out}"

lucaspbordignon commented 3 years ago

Hey @Shahulul!

In order to gather more context to help with the fix, are you running the application on a simulator or a physical device?

Also, noticed that you said that sometimes it gives a timeout, does that work eventually or it always return the exception?

Shahulul commented 3 years ago

@lucaspbordignon I am tested this on the simulator. It works most of the time. The exception occurs rarely.

lucaspbordignon commented 3 years ago

@Shahulul

Got it! I've put the issue under investigation, will try to replicate the issue and gather more context around that

fakeheal commented 3 years ago

@lucaspbordignon Have you had any success in reproducing this issue?

shmkane commented 2 years ago

@lucaspbordignon also curious if there's been any further progress? Having a similar issue #182 but I'm not getting any error.