Regular heartbeat to server when app is in background

Is there a way for us to be able to make a heartbeat webservice call from the app, while it is in background, say every 15 min?

Timers don't work in background since iOS will suspend the app, and its not a one time heartbeat which we can use background processing/fetch for.


To note, this will not be an infinite activity. Only for a period of time.

Replies

Is there a way for us to be able to make a heartbeat webservice call from the app, while it is in background, say every 15 min?

No. iOS puts strict limits on background execution and there’s no general-purpose way to resume (or relaunch) your app in the background on that sort of interval.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks


The scenario here is that app has a 15 minute timeout. While user is using the app, we allow them to make a phone call, which opens the Phone app, and puts our app in background. Once call is over, we want to be able to capture that. If call goes over 30 mins, app has timed out in the background and we are looking for a way to keep it alive.

If call goes over 30 mins …

You mean 30 seconds, right?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

No, I meant Phone call. If the Phone call continues for 30 mins, app has timed out in the background in 15 mins.
Looking for a way to avoid that.

Hmmm. FYI, 30 seconds is the current default background execution time allowed by a

UIApplication
background task, and hence my confusion.

If the Phone call continues for 30 mins, app has timed out in the background in 15 mins.

I’m not sure where you’re getting 15 minutes from. Unless your app has access to one of the more power background modes, you’re reliant on

UIApplication
background tasks and those won’t give you anything like 15 minutes.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"