Closed AppalaNaidu01 closed 2 weeks ago
I think you're just not waiting long enough in the background. Events are not triggered after exactly 15 min, and often not anything even close to that.
It can take days before Apple's machine-learning algorithm figures out how often to fire events (based upon how often and how long your app is used). I suggest you leave your app in the background for several days and evaluate progress then. You will see that eventually events start firing in the background.
There is an /example
app in this repo which persists fetch events and renders them to a List
component. Install the /example app on your device and let it run untouched for a long period of time in the background.
Actually, you should bring your app to the foreground at least once daily. If you don't, Apple will assume your app is unused and stop firing events.
One question, If the app has not been opened after updating with the new code, is there any chance for the task to run ?
I don't know.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Your Environment
react-native -v
): 0.72.5Expected Behavior
A scheduled trigger should happen when the app is in the background, in that trigger it should fetch some data from the server and display local notifications.
Actual Behavior
The scheduled task happens when the user launches the app from the background to the foreground, as I can see that the notifications are showing up every time only when I open the app. Also, when I simulated using the lldb command by closing the app, I could see that the API call and all the consecutive methods were calling only when I opened the app.
Steps to Reproduce
Context
I need to do all these steps when a scheduled background fetch task triggers:
Debug logs