Open valiaghaei opened 4 years ago
As per -> https://github.com/jamesisaac/react-native-background-task#android
Android
The linking of the library can be done automatically by running:
react-native link react-native-background-task
One manual step is still needed - in your project file `android/app/src/main/java/myapp/MainApplication.java`, add the following to the end of the `onCreate()` method:
BackgroundTaskPackage.useContext(this);
Hi it does not work for me and I got warning register headless js , i want to run this code in background BackgroundTask.define(() => { console.log('Hello from a background task'); BackgroundTask.finish(); }); but I do not you what exactly should i register in headless js ? could you please anyone help me