iOS访问健康数据
来源:互联网 发布:风控模型算法spss 编辑:程序博客网 时间:2024/06/06 09:49
HKQuantityType *heightType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeight]; //身高HKQuantityType *weightType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass]; //体重HKQuantityType *temperatureType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyTemperature]; //体温HKQuantityType *stepCountType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount]; //步数HKQuantityType *distanceWalkingRunningType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierDistanceWalkingRunning]; //步行+跑步距离HKQuantityType *distanceCyclingType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierDistanceCycling]; //骑车距离HKQuantityType *activeEnergyType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierActiveEnergyBurned]; //活动能量//以下三个不允许写入HKCharacteristicType *birthdayType = [HKObjectType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierDateOfBirth]; //出生日期HKCharacteristicType *sexType = [HKObjectType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBiologicalSex]; //性别HKCharacteristicType *bloodType = [HKObjectType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBloodType]; //血型HKCategoryType *sleepAnalysisType = [HKObjectType categoryTypeForIdentifier:HKCategoryTypeIdentifierSleepAnalysis]; //睡眠分析HKCategoryType *mindfulSessionType = [HKObjectType categoryTypeForIdentifier:HKCategoryTypeIdentifierMindfulSession]; //正念NSSet *shareTypes = [NSSet setWithObjects: heightType, temperatureType, weightType, distanceCyclingType, distanceWalkingRunningType, sleepAnalysisType, mindfulSessionType, nil];NSSet *readDataTypes = [NSSet setWithObjects: heightType, bloodType, temperatureType, birthdayType, sexType, weightType, stepCountType, distanceCyclingType, distanceWalkingRunningType, activeEnergyType, sleepAnalysisType, mindfulSessionType, nil];HKHealthStore *healthStore = [[HKHealthStore alloc] init];[healthStore requestAuthorizationToShareTypes:shareTypes readTypes:readDataTypes completion:^(BOOL success, NSError *error) { if (success) { }else{ UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"健康权限授权结果" message:@"授权失败" preferredStyle:UIAlertControllerStyleAlert]; [self presentViewController:alert animated:YES completion:nil]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [alert dismissViewControllerAnimated:YES completion:nil]; }); } }];
阅读全文
0 0
- iOS访问健康数据
- iOS健康数据分析
- ios 健康HealthKit的数据采样
- iOS获取设备常用健康数据
- iOS 三方app读取苹果健康数据
- 十,iOS 健康数据获取权限和写入权限
- IOS -- 获取用户的健康数据的运动步数
- ios中访问通讯录数据
- <iOS>swift中全局数据访问定义
- iOS 多线程安全高效的访问数据
- iOS-获取手机健康步数,去除人为添加的数据
- iOS-获取手机健康步数,去除人为添加的数据
- iOS-获取手机健康步数,去除人为添加的数据
- iOS访问https无数据,访问http正常
- iOS 健康 计步 卡路里
- 健康数据的获取 Iphone
- 医疗健康大数据基础知识
- iOS SDK使用指南:利用UIDevice及NSLocale访问设备数据
- bootstrap初学笔记
- 安装TensorFlow和keras
- 迅雷半个月股价暴涨三倍居然做了这件事!
- 无损数据压缩LZW算法——C++实现
- nlogn排序-归并排序
- iOS访问健康数据
- 7.网络编程
- Affinity Photo(图片处理软件)官方中文版V1.6.0.89下载 | affinity photo 破解版
- 深度学习与卷积神经网络--识别鸟
- Servlet本地测试与远程部署
- Affinity Designer(图片设计工具)官方中文版V1.6.0.89下载 | affinity designer windows破解版
- 【Linux】常见命令总结
- iOS创建自定义相册
- 列表生成式,列表生成器,迭代器