transistorsoft / react-native-background-fetch

Periodic callbacks in the background for both IOS and Android
MIT License
1.43k stars 191 forks source link

Background service not starting on some iOS devices #459

Closed EmpiteChamika closed 1 week ago

EmpiteChamika commented 9 months ago

Your Environment

Expected Behavior

The background service starts after a couple of days of using the application

Actual Behavior

In one of the devices we use for QA purposes, the background service has not started even after 4 days of app usage (on average 4-5 hours a day). Could a case like this occur where 2 of the 3 devices started the background service after around 2 days of testing the app but one device has not started it even after 4 days of running the app?

Steps to Reproduce

  1. Install the app using TestFlight to the iOS device
  2. Plug the device to power with the app running in the foreground

Context

I am sending data to a backend database using an api call in the background service

christocracy commented 9 months ago

It's completely up to the OS to fire events. iOS presumably uses a machine-learning model to decide when / if to fire events, based upon the frequency of app usage. If the app is not brought to foreground daily, the OS will stop firing events to the plugin.

There is nothing the plugin can do to make events fire more consistently.

Also, if the user terminates the app, there will be no events fired (there is no such thing a stopOnTerminate: false for iOS).

christocracy commented 9 months ago

If you've verified that simulated events fire, that's all you can do to ensure that everything is setup and working correctly. Everything else is up to iOS' machine-learning model.

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 week ago

This issue was closed because it has been inactive for 14 days since being marked as stale.