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:

Exploring The Aha Stack: Astro, Htmx, Alpine — A Complete Tutorial With A Demo Project And Comparison To Other Stacks

Exploring the AHA stack: Tutorial, demo, and comparison

The AHA stack — Astro, htmx, and Alpine — is a solid web development stack for smaller apps that emphasize frontend speed and SEO.

Oyinkansola Awosan
May 3, 2024 â‹… 13 min read
Comparing Hattip Vs Express Js For Modern Application Development

Comparing Hattip vs. Express.js for modern app development

Explore what Hattip is, how it works, its benefits and key features, and the differences between Hattip and Express.js.

Antonello Zanini
May 2, 2024 â‹… 8 min read
Using React Shepherd To Build A Site Tour

Using React Shepherd to build a site tour

React Shepherd stands out as a site tour library due to its elegant UI and out-of-the-box, easy-to-use React Context implementation.

Onuorah Bonaventure
May 1, 2024 â‹… 14 min read
A Guide To Cookies In Next Js

A guide to cookies in Next.js

Cookies are crucial to web development. This article will explore how to handle cookies in your Next.js applications.

Georgey V B
Apr 30, 2024 â‹… 10 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