React Native Reminders is a modern, well-supported, and cross-platform Reminders for React Native
yarn add @lampn9397/react-native-reminders
Or
npm install @lampn9397/react-native-reminders
Linking the package manually is not required anymore with Autolinking.
-
iOS Platform:
$ npx pod-install
# CocoaPods on iOS needs this extra step
You then need to link the native parts of the library for the platforms you are using. The easiest way to link the library is using the CLI tool by running this command from the root of your project:
react-native link @lampn9397/react-native-reminders
iOS
The user's permission is required in order to access the Reminders on devices running iOS 10 or later. Add the NSRemindersUsageDescription
key in your Info.plist
with a string that describes how your app will use this data. This key will appear as Privacy - Photo Library Usage Description
in Xcode. If you try to access Reminders without this permission, your app will exit.
Android
Permission is required to read and write to the Calendar.
<manifest>
...
<uses-permission android:name="android.permission.READ_CALENDAR"/>
<uses-permission android:name="android.permission.WRITE_CALENDAR"/>
...
<application>
Then you have to explicitly ask for the permission
import Reminders from "@lampn9397/react-native-reminders";
// Request permission
Reminders.requestPermission();
// Get reminders
Reminders.getReminders();
// Add reminder
Reminders.addReminder({
title: 'Wake-up reminder',
note: 'Wake-up and have breakfast!',
timestamp: Date.now() * 60000 * 5, // next five minutes from current time (milliseconds)
});
// Remove reminder
Reminders.removeReminder('the-reminder-id');
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT