Quay lại Trending
RepositoryJavaSEThụy Điển
VI

vikeri/react-native-background-job

Schedule background jobs in React Native that run your JavaScript when your app is in the background/killed.

746sao
108fork
71issue
0lượt xem

🚀 Chạy JavaScript ngay cả khi app đóng hoặc ở nền trên Android

react-native-background-job giúp lên lịch và thực thi mã JavaScript trong nền hoặc ngay cả khi ứng dụng đã bị đóng hoàn toàn.

Đây là thư viện React Native dùng để lên lịch các công việc (jobs) chạy JavaScript khi ứng dụng ở chế độ nền hoặc đã bị đóng. Dựa trên công nghệ HeadlessJS của React Native (chỉ hỗ trợ Android), thư viện này cho phép các tác vụ tiếp tục chạy ngay cả khi người dùng không mở ứng dụng.

✨ Điểm nổi bật

  • Hỗ trợ Android duy nhất: Dựa trên HeadlessJS, chỉ hoạt động trên Android.
  • Firebase JobDispatcher (mặc định): Lên lịch năng động, tiết kiệm pin, tương thích ngược.
  • AlarmManager (chế độ exact): Dùng cho kiểm thử, thời gian thực nhưng không bền vững.
  • register(): Đăng ký job và hàm JavaScript gắn liền.
  • schedule(): Lên lịch thực thi job.
  • cancel() / cancelAll(): Hủy job đơn lẻ hoặc tất cả.
  • allowExecutionInForeground: Cho phép chạy job ngay cả khi app đang mở.
  • Tự động khôi phục: Job tự động chạy lại sau khi thiết bị khởi động lại.

💡 Vì sao đáng chú ý

Khác với các giải pháp khác chỉ chạy khi app mở, thư viện này đảm bảo JavaScript được thực thi ngay cả khi app đóng hoàn toàn nhờ HeadlessJS. Phù hợp cho các tác vụ nền như đồng bộ dữ liệu, gửi thông báo, hoặc xử lý định kỳ mà không cần người dùng can thiệp.


#ReactNative #BackgroundJob #Android #HeadlessJS #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryJava
jobrunr/jobrunr

An extremely easy way to perform background processing in Java. Backed by persistent storage. Open and free for commercial use.

3.1k
Nov 27, 2026
RepositoryC#
HangfireIO/Hangfire

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required

10.2k
Oct 30, 2026
RepositoryC#
jamesmh/coravel

Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze!

4.3k
Jul 20, 2025
RepositoryTypeScript
node-cron/node-cron

Job scheduling for Node.js with overlap prevention, distributed coordination, and background tasks. Zero dependencies.

3.3k
Nov 7, 2026
RepositoryPython
django-commons/django-tasks-scheduler

Schedule async tasks using redis protocol. Redis/ValKey/Dragonfly or any broker using the redis protocol can be used.

231
Nov 23, 2026
RepositoryKotlin
brewkits/kmpworkmanager

KMP WorkManager - Unified API for scheduling and managing background tasks—one‑off, periodic, exact and chained jobs—featuring advanced triggers, structured logging, event‑driven completion, demo UI and docs.

217
Oct 2, 2026
RepositoryC++
react/react-native

A framework for building native applications using React

127.0k
Nov 27, 2026
RepositoryTypeScript
storybookjs/storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation

91.8k
Nov 29, 2026
Repository
enaqx/awesome-react

A collection of awesome things regarding React ecosystem

75.4k
Sep 4, 2026