开发者

NSTimer doesn't work in sleep mode?

开发者 https://www.devze.com 2023-03-16 10:26 出处:网络
In my App, i have set the timer for 3, 10 and 开发者_运维问答15 mins,but it goes to sleep mode and the audio doesn\'t ring.And after a long time it starts vibrating.Please help me with this issue.

In my App, i have set the timer for 3, 10 and 开发者_运维问答15 mins,but it goes to sleep mode and the audio doesn't ring.And after a long time it starts vibrating.Please help me with this issue.

Thanks in advance.


To save battery and resources, not all apps can run in the background, so when the device goes to sleep, your app might not be killed, but it does stop executing.

You can use UILocalNotifications to play the sound you want even if your app is not running.


Timer does not work in deep sleep mode, but you can make app awake by applying idleTimerDisabled property to TRUE, but remember, if you use this, battery will be utilized more....

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号