react-native-add-calendar
v1.0.8
Published
allows adding events to native device calendar
Readme
react-native-add-calendar
Allows you to add events to the native device calendar
Installation
npm install react-native-add-calendar react-native-nitro-modules
> `react-native-nitro-modules` is required as this library relies on Nitro ModulesUsage
import { 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',
});Demo
iOS setup
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 setup
Android is ready to go after downloading library 🥳
Contributing
License
MIT
Made with create-react-native-library
