ios - 应用被拒绝,健康应用权限

标签 ios iphone swift watchkit healthkit

我的应用程序无法获得批准,老实说,我无法理解 Apple 在这种情况下的意图。

我的应用仅使用 HealthKit 来创建、暂停和完成锻炼。它不读取任何数据。

来自苹果: “关于 2.1 问题,您的应用程序在启动 watch 应用程序后不久就会在 iOS 上显示一个窗口,以启动允许您的应用程序与健康应用程序集成的过程。点击“打开 [AppName] 后没有任何操作发生。确保您的应用程序显示 Health UI 以允许访问 Health 应用程序是合适的。”

问题似乎出在我的 watchOS 应用程序未请求使用健康应用程序的权限。这是我用来执行此操作的代码:

在我的 ExtensionDelegate 中:

WorkoutManager.sharedManager.requestAuthorisation()

我的 WorkoutManager 中的 requestAuthorisation 函数:

//request workout authorisation only
func requestAuthorisation() {
    let writeTypes: Set<HKSampleType> = Set([ HKObjectType.workoutType() ]) //to write a workout

    healthStore.requestAuthorization(toShare: writeTypes, read: nil) { (success, error) in
        if error != nil {
            self.debug.log(tag: "WorkoutManager", content: "Error requesting HealthStore authorisation: \(error!.localizedDescription)")
        }
    }
}

另外,我的 iOS 应用程序不使用 HealthKit(至少目前是这样),所以我没有在 iOS 应用程序中使用 HealthKit 做任何事情。只有 watchOS 应用程序使用 HealthKit。

当您首次在 watch 上运行该应用程序时,它会提示您允许授权访问健康应用程序。 iPhone 上会出现一个接受或拒绝弹出窗口,您可以在其中进行选择。我以为这就是他们想要的?他们肯定不希望我自定义编写一些“你想允许访问健康应用程序” View Controller 吗?

最佳答案

Apple 对他们的应用程序非常严格,所以你需要尽可能多地提供详细信息,当弹出窗口打开时,它需要明确询问用户是否允许它与健康应用程序通信

关于ios - 应用被拒绝,健康应用权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42568105/

相关文章:

ios - : Developer/Enterprise? 是哪个分发程序

iphone - 使用 UISearchBar 关闭键盘,而不放弃第一响应者

for-loop - swift for loop 在 Playground 中工作但在真实代码中不工作

ios - 如何让 LineBreakMode 在 UITableViewCell 中工作? iOS- swift

ios - 根据单元格选择将核心数据传递给 ViewController

ios - 蓝牙低功耗作为 iOS 设备要求?

iphone - 在模拟器中第二次运行 ios 应用程序时登录

ios - CocoaPods 更新正在降级已安装的 pod

ios - NSURLCredential 创建返回 null

iphone - iOS 中的基本 Sprite/UIImage 运动?