2021-12-16
1470
#react native
Debjyoti Banerjee
83010
Dec 16, 2021 â‹… 5 min read

Run React Native background tasks with Headless JS

Debjyoti Banerjee I'm Debjyoti, software engineer and game developer. Currently exploring JavaScript and Flutter, and trying to come up with solutions to problems in the healthcare sector. Love open source.

Recent posts:

Implementing Infinite Scroll In Next Js With Server Actions

Implementing infinite scroll in Next.js with Server Actions

Infinite scrolling in Next.js no longer requires external libraries — Server Actions let us fetch initial data directly on the server.

Rahul Chhodde
Apr 19, 2024 â‹… 10 min read
Integrating Django Templates With React For Dynamic Webpages

Integrating Django templates with React for dynamic webpages

Create a dynamic demo blog site using Django and React to demonstrate Django’s server-side functionalities and React’s interactive UI.

Kayode Adeniyi
Apr 18, 2024 â‹… 7 min read
Using Aoi Js To Build A Bot For Discord

Using aoi.js to build a bot on Discord

Explore how the aoi.js library makes it easy to create Discord bots with useful functionalities for frontend applications.

Rahul Padalkar
Apr 17, 2024 â‹… 9 min read
Web Components Adoption Guide: Overview, Examples, And Alternatives

Web Components adoption guide: Overview, examples, and alternatives

Evaluate Web Components, a set of standards that allow you to create custom HTML tags for more reusable, manageable code.

Elijah Asaolu
Apr 16, 2024 â‹… 11 min read
View all posts

9 Replies to "Run React Native background tasks with Headless JS"

  1. Where is the BackgroundWorker function created? Are you able to provide a sample of the project structure?

  2. please add import statements of classes. or provide the sample example repo link. android studio not importing automatically.

    1. I’m not aware of your requirements but according to the Android docs, it recommends high priority FCM messages as they are exempt from background restrictions.
      Also, you could try updating your app logic to do something in the work manager but not start a foreground service.
      You could also look into AlarmManager if that suits your use case.

  3. The lack of import statements makes this an hours-long task to reproduce. On top of that, there’s several functions here that just… don’t exist. `bundleExtras` and createChannel` are completely undefined and I can’t find anything online to replace them with or import them from. Kind of useless

    1. Intent service = new Intent(getApplicationContext(), MyTaskService.class);
      Bundle bundle = new Bundle();

      bundle.putString(“foo”, “bar”);
      service.putExtras(bundle);

      getApplicationContext().startService(service);

Leave a Reply