LynxCalendar
Adds a booking, a ticket or an appointment to the person's calendar, through the phone's own event editor. import { LynxCalendar } from '@blotch/angular-lynx';
No calendar permission needed. The editor opens filled in with your event. The person picks the calendar and saves it, and your app never sees their calendars.
Turn it on
Add calendar to the build target's options in angular.json:
What it adds:
- iOS: the module that opens EventKitUI's event editor. It needs no reason, since the editor needs no calendar permission.
- Android: the module, and the lines that open the calendar app's editor. It needs no permission either.
Without it, the native code behind the editor is left out of both apps, and addEvent() rejects with unavailable.
See Turn on device features for every setting.
Usage
Booking stands for the app's own type.
API
LynxCalendar
addEvent(event)
Opens the editor with event, and resolves with how it closed:
It throws a TypeError for an event without a title, with an invalid Date, or that ends before it starts. It rejects with a CalendarError when there's no editor to open.
Don't count on saved on Android. Google Calendar answers the same whether or not the person saved. Show what's next as if the event was added, and let the person add it again if they want.
CalendarEvent
CalendarError
addEvent() rejects with it. Its code is:
Testing
calendarEvents() lists the events the app opened the editor with, and answerCalendarSheet() closes it:
Related
- Turn on device features: the
calendaroption and the other opt-in build options LynxShare: share a booking instead
