rn-alarm-kit
v0.0.8
Published
A React Native module that provides native alarm scheduling capabilities
Maintainers
Readme
rn-alarm-kit
🚧 Under Construction 🚧
⚠️ This library is currently under active development and is not yet production-ready.
- 🔨 APIs may change without notice
- 📝 Documentation is being improved
- 🐛 Known issues are being addressed
- ✨ New features are being added
Use at your own risk in production environments.
A React Native module that provides native alarm scheduling capabilities using iOS 26's AlarmKit framework. Create powerful, system-level alarms with one-time or recurring schedules and custom UI presentations.
Platform Support
| Platform | Status | Minimum Version | | -------- | -------------- | --------------- | | iOS | ✅ Supported | iOS 26.0+ | | Android | 🔜 Coming Soon | TBA |
Note: Android support is planned for a future release.
✨ Features
- ✅ Schedule alarms at specific times (24-hour format)
- ✅ One-time or recurring alarms (weekly schedule)
- ✅ Custom alarm UI with title, buttons, and colors
- ✅ Request alarm authorization
- ✅ List all scheduled alarms
- ✅ Cancel all alarms
- ✅ Built with Expo Modules for seamless integration
Requirements
- iOS 26.0+
- React Native with Expo
- Xcode 26.0+
Installation
npm install rn-alarm-kitOr with yarn:
yarn add rn-alarm-kitiOS Setup
Add the following to your Info.plist:
<key>NSAlarmKitUsageDescription</key>
<string>We'll schedule alerts for alarms you create within our app.</string>Update your Podfile to set the minimum iOS version:
platform :ios, '26.0'Then run:
cd ios && pod installUsage
Request Authorization
Before scheduling alarms, request user authorization:
import ReactNativeAlarmkit from "rn-alarm-kit";
const authorized = await ReactNativeAlarmkit.requestAuthorization();
if (authorized) {
console.log("Alarm permissions granted");
}Schedule a One-Time Alarm
// Schedule alarm for 8:30 AM (one-time)
const alarmId = await ReactNativeAlarmkit.scheduleAlarm(
8, // hour (0-23)
30, // minute (0-59)
null // no repeat days
);
console.log("Alarm scheduled:", alarmId);Schedule a Recurring Alarm
// Schedule alarm for 7:00 AM on Monday, Wednesday, Friday
const alarmId = await ReactNativeAlarmkit.scheduleAlarm(
7, // hour
0, // minute
[2, 4, 6] // days: 1=Sun, 2=Mon, 3=Tue, 4=Wed, 5=Thu, 6=Fri, 7=Sat
);Schedule Daily Alarm
// Schedule alarm for 6:00 AM every day
const alarmId = await ReactNativeAlarmkit.scheduleAlarm(
6, // hour (6:00 AM)
0, // minute
[1, 2, 3, 4, 5, 6, 7] // All days of the week
);Weekends Only
// Schedule alarm for 9:00 AM on weekends
const alarmId = await ReactNativeAlarmkit.scheduleAlarm(
9, // hour (9:00 AM)
0, // minute
[1, 7] // 1=Sunday, 7=Saturday
);List All Alarms
const alarms = ReactNativeAlarmkit.listAlarms();
// Returns array of alarm objects:
// [
// {
// id: "UUID-STRING",
// state: "scheduled",
// scheduledTime: "08:30 (Mon, Wed, Fri)"
// }
// ]Canel an Alarm
TODO
Cancel All Alarms
const result = ReactNativeAlarmkit.cancelAllAlarms();
console.log(`Cancelled ${result.cancelledCount} alarms`);API Reference
requestAuthorization(): Promise<boolean>
Requests permission to schedule alarms. Returns true if authorized, false otherwise.
scheduleAlarm(hour: number, minute: number, repeatDays: number[] | null): Promise<string>
Schedules an alarm and returns its unique ID.
Parameters:
hour(0-23): Hour in 24-hour formatminute(0-59): MinuterepeatDays(optional): Array of days to repeat (1=Sunday, 2=Monday, ..., 7=Saturday). Passnullor empty array for one-time alarm.
Returns: Alarm UUID as a string
listAlarms(): Array<AlarmInfo>
Returns all scheduled alarms.
Returns: Array of objects with:
id: Alarm UUIDstate: Current alarm state (e.g., "scheduled", "alerting")scheduledTime: Formatted time and repeat days (e.g., "08:30 (Mon, Wed)")
cancelAllAlarms(): { success: boolean, cancelledCount: number }
Cancels all scheduled alarms.
Returns: Object with success status and count of cancelled alarms
Example
See the example app for a complete implementation with a UI for:
- Day selection checkboxes
- Time input (hour and minute)
- Alarm listing
- Cancel all functionality
Day Number Reference
When scheduling recurring alarms, use these numbers:
1- Sunday2- Monday3- Tuesday4- Wednesday5- Thursday6- Friday7- Saturday
Time Format
All times use 24-hour format:
0= midnight (12:00 AM)12= noon (12:00 PM)23= 11:00 PM
Platform Support
Currently iOS only (requires iOS 26.0+). Android support to be added at some point in the near feature
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
MIT
Author
Wael Fadlallah (@wael-fadlallah)
