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

Permission request modal keeps showing up #406

Open
abakers opened this issue Jan 27, 2025 · 0 comments
Open

Permission request modal keeps showing up #406

abakers opened this issue Jan 27, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@abakers
Copy link

abakers commented Jan 27, 2025

Describe the bug
Running AppleHealthKit.initHealthKit in a useEffect shows the permission modal each time we navigate to that screen. Even though permission was granted/denied.

To Reproduce
Steps to reproduce the behavior:

  1. Add the following snippet to a screen:
  useEffect(() => {
    AppleHealthKit.initHealthKit(
      {
        permissions: {
          read: [AppleHealthKit.Constants.Permissions.Workout],
          write: [],
        },
      },
      error => {
        if (error) {
          console.error('initHealthKit error: ', error);
        }
      },
    );
  }, []);
  1. Navigate to this screen -> permission modal will show up -> deny
  2. Navigate back one step
  3. Navigate to the same screen -> permission modal will show up again

Expected behavior
Permission modal should only show up once. This has worked previously, and without any changes whatsoever to this part of our code (not even package updates), this has now stopped working.

Screenshots

ScreenRecording_01-27-2025.12-55-42_1.1.mp4

Smartphone (please complete the following information):

  • Device: iPhone 15 Pro Max
  • OS: [iOS18.1.1]
  • Version [1.19.0] (same problem in 1.18.0)

Also tried on the following devices with iOS18.1.1:
iPhone 14 <-- same problem
iPhone 15 Pro <-- not an issue
2x iPhone 14 Pro <-- not an issue

And these with iOS18.2.1
iPhone 16 Pro Max <--- same problem

@abakers abakers added the bug Something isn't working label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant