healthStore.requestAuthorization() crashes Apple watch application

296 views Asked by At

I'm trying to collect health data in my Apple Watch application but when I call healthStore.requestAuthorization my app always crashes. I have set NSHealthShareUsageDescription and NSHealthUpdateUsageDescription in Info.plist as required but it still crashes.

I started a new project and am just trying to request authorisation, there is no other functionality that could affect it.

Any ideas why this is?

Thanks for any help.

1

There are 1 answers

0
Peter C On BEST ANSWER

I found what the issue was. There are two Info.plist files that need NSHealthShareUsageDescription and NSHealthUpdateUsageDescription. One in the project file and one in the watch extension file. I had only done one of these. The strings for these also need to be a reasonable length and cannot be just a couple of words.