Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Why does the HealthKit permission sheet introductory text say

[App Name] would like to access and update your health data in the categories below

even though my app is only requesting read permission?

HealthKit permission sheet

Is there a way to change the introductory text to say the app only asks access to the data but doesn't update/write any data?

My method to request authorization:

    func authorizeHealthKit(completion: @escaping () -> Void ){
    let readTypes = Set([
        HKObjectType.quantityType(forIdentifier: .stepCount)!,
        HKObjectType.quantityType(forIdentifier: .distanceWalkingRunning)!,
        HKObjectType.quantityType(forIdentifier: .appleExerciseTime)!,
        HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)!,
        HKObjectType.quantityType(forIdentifier: .basalEnergyBurned)!,
        HKObjectType.quantityType(forIdentifier: .flightsClimbed)!,
        HKObjectType.quantityType(forIdentifier: .appleStandTime)!,
        HKObjectType.quantityType(forIdentifier: .distanceWheelchair)!,
        HKObjectType.quantityType(forIdentifier: .pushCount)!,
        HKObjectType.categoryType(forIdentifier: .appleStandHour)!,
        HKObjectType.activitySummaryType(),
        HKObjectType.workoutType()
    ])
    
    healthStore.requestAuthorization(toShare: nil, read: readTypes) { (success, error) in
        if let error = error {
            print("Request authorization error: (error)")
            return
        }
        completion()
    }
}

My info.plist only contains the NSHealthShareUsageDescription key.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
467 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...