简体   繁体   English

HealthKit requestAuthorization对话框未出现

[英]HealthKit requestAuthorization dialog not appearing

I have been consistently unable to get the HealthKit requestAuthorization dialog to appear. 我一直无法获取HealthKit requestAuthorization对话框。 This has been the case for two different phones with different OS versions and different installation methods (see below). 对于具有不同OS版本和不同安装方法的两部不同手机,情况就是如此(请参见下文)。 The requestAuthorization code is standard boilerplate code, such as: requestAuthorization代码是标准的样板代码,例如:

HKCharacteristicType *genderType = [HKObjectType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBiologicalSex];
[self.healthStore requestAuthorizationToShareTypes:nil readTypes:[NSSet setWithObjects: genderType, nil] completion:^(BOOL success, NSError *error) {
    NSLog(@"requestAuthorization completion block");
}];

I've tried a fresh app with just that code, tried different parameters for the requestAuthorization method call, and have tried resetting our systems in a number of different ways: app uninstall, resetting settings, erasing phone content and setting with existing partial backup; 我尝试了一个仅包含该代码的全新应用,尝试了requestAuthorization方法调用的不同参数,并尝试通过多种不同方式重置系统:应用卸载,重置设置,擦除手机内容以及使用现有的部分备份进行设置; erasing phone content and settings with a full backup, erasing content and settings and starting phone as a new phone. 通过完全备份删除电话内容和设置,删除内容和设置并将电话作为新电话启动。 Have tried multiple different readTypes and shareTypes. 尝试了多种不同的readType和shareType。 Each time requestAuthorization is called on a fresh app install, the following error code appears: 每次在全新的应用程序安装上调用requestAuthorization时,都会出现以下错误代码:

"Error occurred = Error Domain=com.apple.healthkit Code=4 "Missing com.apple.developer.healthkit entitlement." UserInfo=0x7fa748534b00 {NSLocalizedDescription=Missing com.apple.developer.healthkit entitlement.}" “发生错误=错误Domain = com.apple.healthkit代码= 4“缺少com.apple.developer.healthkit权利。” UserInfo = 0x7fa748534b00 {NSLocalizedDescription =缺少com.apple.developer.healthkit权利。}”

However, the HealthKit entitlements are set in both Capabilities on xcode as well as Capabilities in the App ID on Apple Developer: Certificates, Identifiers, and Profiles. 但是,在xcode上的功能以及Apple Developer上的App ID中的功能(证书,标识符和配置文件)中都设置了HealthKit权利。

- Questions: How do I fix this issue so the requestAuthorization dialog appears? -问题: 如何解决此问题,以便出现requestAuthorization对话框? What is a possible cause of phones getting into a state where they get this error consistently? 手机进入持续出现此错误的状态的可能原因是什么?

- Phones used: iPhone 6, iPhone 6 Plus - OS Versions used: iOS 9.0 / 9.0.2 / 9.1 / 9.2 - Methods of loading app onto phone: iOS App Store, Watch App App Store, TestFlight, xcode - Situations where this appears to not be broken: With our users' (non-development) phones installing via the App Store. -使用的手机: iPhone 6,iPhone 6 Plus- 使用的操作系统版本: iOS 9.0 / 9.0.2 / 9.1 / 9.2- 将应用程序加载到手机上的方法: iOS App Store,Watch App App Store,TestFlight,xcode- 出现这种情况的情况不会损坏:通过我们的用户(非开发)手机通过App Store安装。

A few things could be causing this. 可能是一些原因造成的。 First, your provisioning profiles could be out of date with what you are actually seeing on the web portal. 首先,您的配置文件可能已与您在Web门户上实际看到的过时了。 Try refreshing these manually from XCode. 尝试从XCode手动刷新它们。

Does your app have an app extension or watchOS app that uses the HealthKit framework? 您的应用程序是否具有使用HealthKit框架的应用程序扩展或watchOS应用程序? Each of extension/watch app will have their own profiles on the web portal, and if the HealthKit framework has been added to any of them without having the entitlement added as well then this could also cause the error. 每个扩展/监视应用程序将在Web门户上具有自己的配置文件,如果HealthKit框架已添加到其中任何一个中而未添加权利,那么这也可能导致错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 HealthKit 的单元测试请求授权 - Unit Test requestAuthorization for HealthKit HealthKit requestAuthorization为correlationType(forIdentifier:.bloodPressure) - HealthKit requestAuthorization for correlationType(forIdentifier: .bloodPressure) HealthKit - requestAuthorization(toShare:read:completion :)总是成功 - HealthKit - requestAuthorization(toShare:read:completion:) always succeeds HealthKit requestAuthorization返回代码100:“授权会话超时” - HealthKit requestAuthorization returns code 100: “Authorization session timed out” HealthKit 许可表未出现 - HealthKit Permission Sheet Not Appearing HealthKit requestAuthorization(toShare :,阅读,完成:):是否有办法知道它是否至少被提示过一次? - HealthKit requestAuthorization(toShare:, read, completion: ) : is there are way to know whether it was promped at least once? 是否可以多次触发推送通知的 requestAuthorization 系统对话框 - Is it possible to trigger the system dialog for requestAuthorization for Push Notifications multiple times 使用HealthKit的活动应用程序中未显示应用程序图标 - App icon not appearing in Activity app using HealthKit GNSPermission警报对话框未出现在iOS中 - GNSPermission Alert Dialog not appearing in iOS Ios:在应用购买对话框中没有出现 - Ios: in app purchase dialog not appearing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM