HKHealthStore request authorization once again

762 views Asked by At

In the previous version of my iOS app I was asking users to grant access to write Dietary Energy in Health app (see the code bellow):

let typesToWrite: Set<HKSampleType> = [HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryEnergyConsumed)!]
healthStore.requestAuthorization(toShare: typesToWrite , read: nil) { (success, error) in
            //...
        }

And many users gave access to write Energy Data to Health app. Now, I want to make an update for my app, and I need to add another sample type: Dietary Sugar, and I would like to show again the Health access window, in order to old users gave access to the Dietary Sugar too. The problem is that this window is not showing anymore for old users. How can I force a request authorization for new added type in update version of the app? Thank you.

0

There are 0 answers