Playing a sound while app is in the foreground and the screen is locked - iOS

后端 未结 2 959
南笙
南笙 2021-01-31 10:43

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

2条回答
  •  猫巷女王i
    2021-01-31 11:12

    See my response above. Basically though

    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!

提交回复
热议问题