agencyenterprise / react-native-health

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

Healthkit permissions prompt closes instantly after opening (> iOS 16.5.1) #331

Closed timmylindh closed 10 months ago

timmylindh commented 10 months ago

Describe the bug When showing Healthkit permission prompt in iOS >16.5.1 the modal closes instantly after opening up without user interaction.

To Reproduce Steps to reproduce the behavior:

  1. Call AppleHealthKit.initHealthKit
  2. Wait for modal to appear
  3. Modal closes instantly

Expected behavior The modal should not close. The user should be able to enable/disable as usual.

Smartphone (please complete the following information):

Additional context Works on all other versions below.

timmylindh commented 10 months ago

UPDATE SOLVED

The issue was because I had a custom modal that started animating out of the screen when the Healthkit modal showed up. Thus the Healthkit modal somehow lost focus and disappeared.

The solution was to hide the custom modal after the Healthkit modal closes instead.