getCalendars(options)

Returns all available calendars from the device’s native Calendar application. If needed, a permission pop-up for the user to grant calendar access is presented first.

A Promise object that resolves as an array of Calendar objects. If an error is encountered, the array is empty.

Use this function to make device calendars available for use with CalendarService.

  • This function is a prerequisite for using any other CalendarService functionality; in other words, this function must be called before any other CalendarService function, except for getCalendarService().
  • If an error occurs, the error is returned via a rejected promise. Handle errors in a catch clause.