我在我的应用程序中使用AppleHealthKit。一切正常。问题是我无法检测到用户在请求许可时是否点击了“不允许”按钮。
使用这种方法,我的应用程序使用HealthKit,即使用户不允许这样做。
requestAuthorizationToShareTypes(healthKitTypesToWrite, readTypes: healthKitTypesToRead) { (success, error) -> Void in
if( completion != nil ) {
completion(success:success,error:error)
}
苹果文档:
所以基本上我的问题是如何检测到这个?