开发者

How long after locking the screen on an iphone does the app keep running?

I've been trying to find the documentation to say how long an app keeps running with an iPhone locked, and how long a network connection stays active.

I'm trying to verify that one of our network connections gets handled correctly once the app has b开发者_C百科een put to sleep and lost network connectivity


It's not based on when the phone locks, it's based on when your application goes in to the background (which locking the phone will do, but so will lots of other things).

short answer: 10 mins.

long answer: there's a variety of special background behaviors, (for VOIP, music streaming, and a few others). Since you didn't say what you're doing, i'm going to assume they don't apply.


Apps stop in approximately 10 minutes with battery > 20%, and in 5 minutes with battery > 5%.

If iPhone is hooked up to a power source (USB / AC), the app will not be auto-stopped (unless it uses too much memory, etc).

You could make your app use background services at locking time, and continue to run without being terminated.


Say your are playing an audio in background, and if you set the number of loops to -1, it will play forever.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜