Inconsistance interval between background task execution

I have a use case in my app where I need to call an API from the device every 30 minutes to verify the app state. In certain cases, the backend records the time of the last received API call or observes the absence of an API call for business logic, making it crucial that the call is executed at fixed intervals.

I am using React Native to build the app and the react-native-background-fetch package to create the background task. As I understand it, the package uses the Background Fetch API under the hood.

From what I have observed and read from other sources so far, there is no guarantee that the task will run every 30 minutes. Is there any way to make the background task more consistent, or is there a better approach to achieve this objective on iOS?

Answered by DTS Engineer in 816390022
I have a use case in my [iOS] app where I need to call an API from the device every 30 minutes to verify the app state.

That’s not an achievable goal, at least not in the general case. I recommend that you have a read of iOS Background Execution Limits and then post back here with any follow-up questions.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I have a use case in my [iOS] app where I need to call an API from the device every 30 minutes to verify the app state.

That’s not an achievable goal, at least not in the general case. I recommend that you have a read of iOS Background Execution Limits and then post back here with any follow-up questions.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@DTS Engineer Thank you for the quick reply, the linked thread was very useful. I am now considering an approach using a "silent push notification".

A push notification is to be initiated from the back-end once or twice every hour when the user is registered to be active. And when the silent notification is received the app makes and API call. Is this a reliable approach or will this also have background restrictions ?

Inconsistance interval between background task execution
 
 
Q