iOS 9 Beta and HealthKit Authorization Issue

We have come across an issue with HealthKit authorization in iOS 9 beta. The authorization call for healthkit - requestAuthorizationToShareTypes is not returning the expected value in "success" parameter.


Per apple docs the "success" parameter in completion block is supposed to return NO, if user cancelled the prompt without permission. However in iOS 9 beta, when user taps "Dont Allow" - "success" value is "YES" and "error" value is nil. https://developer.apple.com/library/prerelease/ios/documentation/HealthKit/Reference/HKHealthStore_Class/index.html#//apple_ref/occ/instm/HKHealthStore/requestAuthorizationToShareTypes:readTypes:completion:


Please let us know if this is expected change in behavior or an issue with iOS 9 completion callback


Thanks!

Below is response from Apple on Bug Report raised. Still not convinced since it contradicts with Apple reference guide at


https://developer.apple.com/library/prerelease/ios/documentation/HealthKit/Reference/HKHealthStore_Class/index.html#//apple_ref/occ/instm/HKHealthStore/requestAuthorizationToShareTypes:readTypes:completion:



In iOS 8, NO was returned when the user canceled authorization or an unexpected error occurred and prevented authorization from completing. In iOS 9, there is no way for the user to cancel authorization. They must choose Allow or Don’t Allow, and both choices finish the process of authorization. Since there is no option to cancel, success = NO is only returned in unexpected situations which prevent the user from choosing to Allow or Don’t Allow. We are closing this bug report. If you have questions regarding the resolution of this issue, please update your bug report with that information. Please be sure to regularly check new Apple releases for any updates that might affect this issue.

iOS 9 Beta and HealthKit Authorization Issue
 
 
Q