You have some crazy idea for an iOS app that uses HealthKit so you fire up Xcode, create a new project & add the HealthKit entitlement. Follow the tutorial to request authorization from the
HKHealthKitStore. Hit run to make sure the app compiles and find that it instantly crashes with a
Puzzled by this you go over the minimal amount of code you've added and pare it right down to just the
HKHealthKitStore.requestAuthorization call which is still causing the
SIGABRT as soon as the app tries to boot.
The missing piece of the puzzle is
Info.plist needs a key adding to it for the HealthKit authorisation screen. The documentation helpfully forgets to mention this however. Here's some quick simple steps to fix it:
Info.plist in Xcode
- Click the
(+) at the top to add a new key/value to the file
- Enter "Privacy - Health Share Usage Description" for the key
- Enter a useful message to the user explaining why they should allow access to their healthkit data for your app for the value
- Run your app and see the HealthKit authorisation sheet appear
NB: if you want to update/write any data to healthkit, you'll need to add the "Privacy - Health Update Usage Description" key with a description as well.
I noticed this morning that my volume down button (-) wasn't working on my iPhone 5 running iOS 7. Pushing the physical button in didn't change the volume. The volume up button increased the volume successfully still.
As is my normal first step debugging iPhone weirdness, I rebooted the phone by turning it off, leaving it off for a few seconds, then booting it back up with the power button. Once powered off and on in this way, the volume down key still didn't decrease the volume.
Fearing a physical button issue at this point, I turned to google for suggestions on what else to try. Running across this thread on Apple's discussion forums, I tried out the solution in there.
- Open "Settings"
- Scroll down and tap on "General"
- Tap on "Accessibility"
- Scroll down to the bottom and tap on "AssistiveTouch"
- Tap the toggle for AssistiveTouch to turn it on, and you should see a little icon appear on screen (white circle contained in a dark grey rounded square)
- Tap the AssistiveTouch icon (was in the top left corner on screen for me)
- Tap on "Device"
- Tap "Volume Down" a bunch of times and you should see the volume being turned down
- Tap outside the AssistiveTouch dialog to close it
- Try pushing the physical Volume Down button
In my case, following these steps made my physical volume down button start working again. Makes me wonder if the solution author on the apple discussion thread is right, in that this is a software issue and forcing a volume down action through the on-screen interface makes it remember that there's a physical button to respond to as well.
Either way, I can stop deafening myself whenever I receive a notification now!