1

How many times can one chain beginBackgroundTaskWithExpirationHandler?

Looking through documentation, the maximum time allowed in beginBackgroundTaskWithExpirationHandler is approximately 10 minutes (always subject to change by iOS). I also see this in the iOS documentation: "You should not use this method simply to keep your application running after it moves to the background."

Is it valid to start a new beginBackgroundTaskWithExpirationHandler once the first task is about to expire? If so, does iOS impose any limit on the times this can be done?

tjg184
  • 4,508
  • 1
  • 27
  • 54
  • You probably can call `-beginBackgroundTask...`. It probably returns `UIBackgroundTaskInvalid`. Try it and see! – tc. Jun 11 '12 at 16:18
  • any progress on this? These alarms seem to keep running some how: Alarm Clock Pro, My Clock, Wave Alarm, Alarmed, iHome – Andres Canella Aug 27 '12 at 05:14
  • @AndresCanella I have not had luck with this. I'm not 100% sure how those Alarm clock apps are doing background stuff. Have you tried to just use a scheduled local notification? – tjg184 Aug 28 '12 at 00:25
  • @tjg184 local notification is a service from iOS and runs independent from your app, it only starts your app if the user clicks on the notif button to go to the app. If set to silent these kinds of notifications will not even sound, ruling local notification out as the method these alarms use. Im still stuck on this like you. Please let me know if you make any progress, lets figure this out. – Andres Canella Sep 01 '12 at 03:27
  • @AndresCanella Did you end up finding a solution to this? – thisiscrazy4 Apr 02 '13 at 04:35
  • @thisiscrazy4 This should solve your problem: http://stackoverflow.com/questions/9725192/how-do-i-start-playing-audio-when-in-silent-mode-locked-in-ios-6 – Andres Canella May 21 '13 at 01:13

0 Answers0