react-native-background-job
react-native-background-job copied to clipboard
How to execute background task when Android app is closed?
Hi all, I already tried to set obj.allowExecutionInForeground to true in my options, but background jobs can not execute app when i closed or exists someone can help me?
Have you tried the example project?
@vikeri : Yes, i have tried in example this is my sourcode:
BackgroundJob.register({
jobKey: workerNotify,
job: () => {
console.log(`Run with app closed`);
// push notify used by firebase
}
});
BackgroundJob.schedule({
jobKey: workerNotify,
period: 1000,
exact: true,
allowExecutionInForeground: true
});
And if you just put your app in the background you don't get any console logs?
@vikeri : yes, I using firebase to push notify it's run normal with app state is active
Same issue for my case. I can't print logs to the console, and can't run background notification when the app is closed. react-native: 0.61.5, react-native-background-job: 2.3.1