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 freeze when use with simulator #409

Open
nusjeff opened this issue Feb 18, 2025 · 0 comments
Open

Permission request modal freeze when use with simulator #409

nusjeff opened this issue Feb 18, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@nusjeff
Copy link

nusjeff commented Feb 18, 2025

Describe the bug
Running AppleHealthKit.initHealthKit in a useEffect shows the permission modal in simulator and get stuck in the permission modal

To Reproduce
Steps to reproduce the behavior:

  1. initHealthKit
const options = {
  permissions: {
    read: [
      AppleHealthKit.Constants.Permissions.AllergyRecord,
      AppleHealthKit.Constants.Permissions.ConditionRecord,
      AppleHealthKit.Constants.Permissions.ImmunizationRecord,
      AppleHealthKit.Constants.Permissions.LabResultRecord,
      AppleHealthKit.Constants.Permissions.MedicationRecord,
      AppleHealthKit.Constants.Permissions.ProcedureRecord,
      AppleHealthKit.Constants.Permissions.VitalSignRecord,
    ],
    write: [],
  },
};

AppleHealthKit.initHealthKit(options, (err, results) => {
        if (err) {
          console.log('Error initializing HealthKit: ', err);
          return;
        }

        // Get HealthKit authorization status
        AppleHealthKit.getAuthStatus(options, (err, results) => {
          if (err) {
            console.log('Error getting HealthKit auth status: ', err);
            return;
          }
          // console.log('Authorization Status: ', results);
        });
      });
  1. Click a button request permission, the permission modal show and freeze
  2. Error: {"message": "Error with HealthKit authorization: Error Domain=com.apple.healthkit Code=100 "Authorization session timed out" UserInfo={NSLocalizedDescription=Authorization session timed out}"}

Screenshots
Image

Smartphone (please complete the following information):

  • Device: [simulator IOS]
  • OS: [ IOS 18.1]
  • Version [1.19.0]
@nusjeff nusjeff added the bug Something isn't working label Feb 18, 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