Allows you to add events to the native device calendar
npm install react-native-add-calendar react-native-nitro-modules
> `react-native-nitro-modules` is required as this library relies on Nitro Modulesimport { addEvent } from 'react-native-add-calendar';
// ...
addEvent({
title: 'Hello world',
description: 'Somewhere over the rainbow',
startDate: 1773759222723, // in milliseconds
endDate: 1773999600000, // in milliseconds
location: 'Idk maybe over there',
url: 'https://github.com/Adoobdoob71',
});
iOS |
Android |
To access the Calendar, add the following keys to your app’s Info.plist (the one in your app, not the library):
<key>NSCalendarsWriteOnlyAccessUsageDescription</key>
<string>Used to add events to the calendar.</string>
<key>NSCalendarsUsageDescription</key>
<string>Used to access calendar information.</string>
⚠️ Note: Without these keys, the app may crash or be rejected by App Store review when calendar access is requested.
and that's it 🥳
Android is ready to go after downloading library 🥳
MIT
Made with create-react-native-library

