Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you seek a solution that will be approved by Apple, you're right you can't use the <code>setKeepAliveTimeout:handler</code> and even if you could - you can't set the timeout to something that's smaller than 600 seconds, so I guess it won't be of a great use anyway (besides that It's not guaranteed to fire the event even remotely close to the timeout you specified. For example, I set it to 600 seconds and some event fired as early as 360 seconds..).</p> <p>About playing the silent sound, except the waste of battery, if you're app has legitimate use for background audio (if you're implementing an alarm clock, that's pretty obvious), I don't see a reason for your app to be rejected, as long as you don't try to use other background features (GPS signal, VoIP handlers, etc).</p> <p>Here's one example app that used this "feature" for their benefit: <a href="http://tapbots.com/blog/pastebot/pastebot-music-in-background" rel="nofollow noreferrer">http://tapbots.com/blog/pastebot/pastebot-music-in-background</a></p> <p>About other methods, you can look in this thread: <a href="https://stackoverflow.com/questions/9725192/how-do-i-start-playing-audio-when-in-silent-mode-locked-in-ios-6">How do I start playing audio when in silent mode &amp; locked in iOS 6?</a></p> <p>On a personal note, it's not very easy to cope with background policies of Apple. Me and my company had (have?) a hard time just to maintain a simple VoIP connection due to all the limitations. My best advice is try to do as less as possible in the background as you can. If the <code>UILocalNotificaion</code> solution suits you, you'll probably should stick to it and live with the limitations.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload