Gathering detailed insights and metrics for react-native-cron-job
Gathering detailed insights and metrics for react-native-cron-job
Gathering detailed insights and metrics for react-native-cron-job
Gathering detailed insights and metrics for react-native-cron-job
npm install react-native-cron-job
Typescript
Module System
Node Version
NPM Version
Java (98.81%)
JavaScript (1.19%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
8 Stars
12 Commits
1 Forks
1 Watchers
1 Branches
2 Contributors
Updated on Jul 24, 2024
Latest Version
1.0.2
Package Id
react-native-cron-job@1.0.2
Unpacked Size
64.87 kB
Size
10.87 kB
File Count
24
NPM Version
7.0.15
Node Version
15.4.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
2
$ npm install react-native-cron-job --save
$ react-native link react-native-cron-job
This package allows you to create cron job locally in your react-native app. You can schedule your task everyday at a particular time. The Cron job will get executed everyday at the given time even if the app is closed.
Add the below code in your index.js file.
1import CronJob from "react-native-cron-job"; 2const CronJobTask = async () => { 3 4 // Do your task here. 5 6 // Be sure to call completeTask at the end. 7 CronJob.completeTask(); 8}; 9AppRegistry.registerHeadlessTask('CRONJOB', () => CronJobTask); 10AppRegistry.registerComponent(appName, () => App);
In your AndroidManifest.xml file add the below code in application tag -
1 2 <service 3 android:name="com.cronjob.CJService" 4 android:enabled="true" 5 android:exported="false" > 6 </service> 7 8 <service 9 android:name="com.cronjob.CJEventService"> 10 </service> 11 12 <receiver 13 android:name="com.cronjob.BootReceiver" 14 android:enabled="true" 15 android:permission="android.permission.RECEIVE_BOOT_COMPLETED"> 16 <intent-filter> 17 <action android:name="android.intent.action.BOOT_COMPLETED" /> 18 <category android:name="android.intent.category.DEFAULT" /> 19 </intent-filter> 20 </receiver> 21
Additionally add below permissions in AndroidManifest.xml -
1 <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> 2 <uses-permission android:name="android.permission.WAKE_LOCK" />
To start cron job just execute the below code. Below function takes 2 integer arguments which is hour and minute (the time at which cronjob starts everyday even if the app is closed). place this code anywhere where you want to start your task. Time range is 0 <= hour <= 23 , 0 <= minute <= 59
1CronJob.startCronJob(22,12); // starts cronjob everyday at 10:12 PM
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 1/9 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More