How to solve this error with healthkit?

后端 未结 6 1069
臣服心动
臣服心动 2021-02-04 20:04

I\'m adding code for healthkit in my ios Swift app, but I\'m getting an error...

 /* Ask for permission to access the health store */
override func viewDidAppear         


        
6条回答
  •  自闭症患者
    2021-02-04 20:20

    This is bcz you have not Open the Capabilities tab in the target editor, and turn on the HealthKit switch.

    and to resolve permission issues , add the following keys in info.plist and write causes.. according to your project requirements. 1.Health Update Usage Description 2.Health Records Usage Description 3.Health Share Usage Description

    You can go ahead with free developer account also for authorisation purpose. good luck

提交回复
热议问题