Preface: I\'m building an alarm clock app. Many other alarm apps such as Alarm Clock Pro are able to play an alarm while the screen is locked and the app is in the foreground. T
I ended up using https://github.com/mruegenberg/MMPDeepSleepPreventer
I ran it in it's own separate xCode project and it only uses 0.5% of the cpu when the app is in the background. It turns out it was my code that was killing the cpu. All is well now!