Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@edenhealth/react-native-calendar-events

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edenhealth/react-native-calendar-events

React Native module for iOS Calendar Events

  • 1.6.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

React Native Calendar Events

npm npm npm

A React Native module to help access and save events to iOS and Android calendars.

Table of contents

Getting started

This package assumes that you already have a React Native project or are familiar with React Native. If not, checkout the official documentation for more details about getting started with React Native.

The following is required for the package to work properly.

Step 1. - Install

Install the react-native-calendar-events library with native code.

npm install --save react-native-calendar-events

Since this package contains native code, you will need to include the code as a library. The React Native documentation on "Linking Libraries" also provides some details for this process.

  • Automatic linking
react-native link
  • Manual linking
    Sometimes "automatic linking" is not sufficient or is not properly including the library. Fortunately, the React Native docs on "Manual Linking" serves a helpful guide (with pictures) in the process.

Step 3. - OS specific setup


API

The following API allows for interacting with both iOS and Android device calendars. See the full list of available event fields.

import RNCalendarEvents from 'react-native-calendar-events';

authorizationStatus

Get calendar authorization status.

RNCalendarEvents.authorizationStatus()

Returns: Promise

  • fulfilled: String - denied, restricted, authorized or undetermined
  • rejected: Error

authorizeEventStore

Request calendar authorization. Authorization must be granted before accessing calendar events.

Android note: This is only necessary for targeted SDK of 23 and higher.

RNCalendarEvents.authorizeEventStore()

Returns: Promise

  • fulfilled: String - denied, restricted, authorized or undetermined
  • rejected: Error

findCalendars

Finds all the calendars on the device.

RNCalendarEvents.findCalendars()

Returns: Promise

  • fulfilled: Array - A list of known calendars on the device
  • rejected: Error

findEventById

Find calendar event by id. Returns a promise with fulfilled found events.

RNCalendarEvents.findEventById(id)

Arguments:

  • id: String - The events unique id.

Returns: Promise

  • fulfilled: Object | null - Found event with unique id.
  • rejected: Error

fetchAllEvents

Fetch all calendar events. Returns a promise with fulfilled found events.

RNCalendarEvents.fetchAllEvents(startDate, endDate, calendars)

Arguments:

  • startDate: Date - The start date of the range of events fetched.
  • endDate: Date - The end date of the range of events fetched.
  • calendars: Array - List of calendar id strings to specify calendar events. Defaults to all calendars if empty.

Returns: Promise

  • fulfilled: Array - Matched events within the specified date range.
  • rejected: Error

saveEvent

Creates or updates a calendar event. - wiki guide

RNCalendarEvents.saveEvent(title, details, options);

Arguments:

  • title: String - The title of the event.
  • details: Object - The event's details.
  • options: Object - Options specific to the saved event.

Returns: Promise

  • fulfilled: String - Created event's ID.
  • rejected: Error

To update an event, the event id must be defined. - wiki guide

RNCalendarEvents.saveEvent(title, {id: 'FE6B128F-C0D8-4FB8-8FC6-D1D6BA015CDE'})

removeEvent

Removes calendar event.

RNCalendarEvents.removeEvent(id, options)

Arguments:

  • id: String - The id of the event to remove.
  • options: Object - Options specific to event removal.

Returns: Promise

  • fulfilled: Bool - Successful
  • rejected: Error

Event fields

PropertyTypeDescriptioniOSAndroid
id*StringUnique id for the calendar event.
calendarId**StringUnique id for the calendar where the event will be saved. Defaults to the device's default calendar.
titleStringThe title for the calendar event.
startDateDateThe start date of the calendar event in ISO format.
endDateDateThe end date of the calendar event in ISO format.
allDayBoolIndicates whether the event is an all-day event.
recurrenceStringThe simple recurrence frequency of the calendar event daily, weekly, monthly, yearly or none.
recurrenceRule **ObjectThe events recurrence settings.
occurrenceDate*DateThe original occurrence date of an event if it is part of a recurring series.
isDetachedBoolIndicates whether an event is a detached instance of a repeating event.
urlStringThe url associated with the calendar event.
locationStringThe location associated with the calendar event.
notesStringThe notes associated with the calendar event.
descriptionStringThe description associated with the calendar event.
alarmsArrayThe alarms associated with the calendar event, as an array of alarm objects.
attendees*ArrayThe attendees of the event, including the organizer.
calendar*ObjectThe calendar containing the event.

Calendar

PropertyTypeDescriptioniOSAndroid
idStringUnique calendar ID.
titleStringThe calendar’s title.
typeStringThe calendar’s type.
sourceStringThe source object representing the account to which this calendar belongs.
isPrimary*BoolIndicates if the calendar is assigned as primary.
allowsModifications*BoolIndicates if the calendar allows events to be written, edited or removed.
color*StringThe color assigned to the calendar represented as a hex value.
allowedAvailabilities*ArrayThe event availability settings supported by the calendar.

Attendees

PropertyTypeDescriptioniOSAndroid
nameStringThe name of the attendee.
email*StringThe email address of the attendee.
phone*StringThe phone number of the attendee.

Recurrence rule

PropertyTypeDescriptioniOSAndroid
frequencyStringEvent recurring frequency. Allowed values are daily, weekly, monthly, yearly.
endDateDateEvent recurring end date. This overrides occurrence.
occurrenceNumberNumber of event occurrences.
intervalNumberThe interval between events of this recurrence.

Alarms

PropertyTypeDescriptioniOSAndroid
dateDate or NumberIf a Date is given, an alarm will be set with an absolute date. If a Number is given, an alarm will be set with a relative offset (in minutes) from the start date.
structuredLocationObjectThe location to trigger an alarm.

Alarm structuredLocation

PropertyTypeDescriptioniOSAndroid
titleStringThe title of the location.
proximityStringA value indicating how a location-based alarm is triggered. Possible values: enter, leave, none.
radiusNumberA minimum distance from the core location that would trigger the calendar event's alarm.
coordsObjectThe geolocation coordinates, as an object with latitude and longitude properties

Options

PropertyTypeDescriptioniOSAndroid
exceptionDateDateThe start date of a recurring event's exception instance. Used for updating single event in a recurring series
futureEventsBoolIf true the update will span all future events. If false it only update the single instance.

* Read only, ** Write only


Wiki

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Big thanks to all who have contributed, raised an issue or simply find use in this project. Cheers!

Keywords

FAQs

Package last updated on 08 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc