react-native-alarm-clock
Getting started
$ npm install react-native-alarm-clock --save
or
$ yarn add react-native-alarm-clock
Automatic installation
$ react-native link react-native-alarm
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.liang.RNAlarmClockPackage;
to the imports at the top of the file - Add
new RNAlarmClockPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-alarm-clock' project(':react-native-alarm-clock').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-alarm-clock/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-alarm-clock')
Usage
import RNAlarmClock from 'react-native-alarm-clock';
// Creates an alarm with the TAG iDream at 17:30 hrs.
RNAlarm.createAlarm('iDream', 17, 30);