Thụy Điểnvikeri/react-native-background-job
Schedule background jobs in React Native that run your JavaScript when your app is in the background/killed.
🚀 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.
An extremely easy way to perform background processing in Java. Backed by persistent storage. Open and free for commercial use.
An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze!
Job scheduling for Node.js with overlap prevention, distributed coordination, and background tasks. Zero dependencies.
Schedule async tasks using redis protocol. Redis/ValKey/Dragonfly or any broker using the redis protocol can be used.
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.
Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation