iOS 5深度睡眠预防 [英] iOS 5 deep sleep prevention

查看:140
本文介绍了iOS 5深度睡眠预防的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个警报应用程序,可以在锁定屏幕模式下触发警报(应用程序位于前台,但屏幕已锁定)。警报必须由NSTimer触发,而不是由uilocalnotification触发。

I'm trying to build an alarm app that can fire an alarm while in locked-screen mode (the app is in the foreground, but the screen is locked). The alarm has to be triggered by a NSTimer not by uilocalnotification.

在iOS 4中,我每隔10秒使用'播放无声音'来阻止应用进入深度睡眠和计时器事件工作正常。但是,在iOS 5中,这似乎不起作用。

In iOS 4 I used the 'play silent sound every 10 seconds' hack to prevent the app from going to deep sleep and the timer events worked fine. However, in iOS 5 this doesn't seem to work.

任何想法?或者这应该工作,我做错了什么?

Any ideas? Or this should work and I'm doing something wrong?

推荐答案

看来你实际上可以使用'播放无声音频' iOS 5中的黑客攻击,但音频必须可听,这意味着您无法在音量设置为 0.0 的情况下播放。

It seems that you actually can use the 'play silent audio' hack in iOS 5, but the audio has to be audible meaning you can't play it at volume set to 0.0.

这篇关于iOS 5深度睡眠预防的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆