iCal v3

 

iCal (basic read and write).

miyako/4d-plugin-ical-v3


Changes due to switching from CalendarStore to EventKit SDK:

  • removed
    • calendar.notes
    • calendar.type “IMAP” (CalCalendarTypeIMAP)
    • calendar.isEditable
    • event.dateStamp
    • recurrenceRule.recurrenceEnd.usesEndDate
  • added

    • calendar.immutable
    • calendar.allowsContentModifications
    • calendar.subscribed
    • event.lastModifiedDate
    • event.creationDate
    • recurrenceRule.weeksOfTheYear
    • recurrenceRule.daysOfTheYear
    • recurrenceRule.setPositions

status:=iCal_Request_permisson
Parameter
Type
Description
status
OBJECT

For this command to work, the main app (4D) must be signin your app with the com.apple.security.personal-information.calendars entitlement and have the NSCalendarsUsageDescription property list key.

status:=iCal QUERY EVENT (options)
Parameter
Type
Description
options
OBJECT
status
OBJECT

Parameters for options

  • startDate: TEXT or DATE
  • endDate: TEXT or DATE
  • calendars: COLLECTION of calendar objects. each object must have a uid or title property

If status.success, a collection of events will be returned in status.events[].

status:=iCal GET CALENDAR LIST
Parameter
Type
Description
status
OBJECT

If status.success, a collection of objects will be returned in status.calendars[].

status:=iCal Get default calendar

Retutns the default calendar and the list of available sources. You can use one of them to create a new calendar.

status:=iCal Create calendar(options)

options: Sepcify a calendar title. By default, a “Local” type is created. You can optinally pass a source title, type or identifier in source. A source identifier or type must match exactly. ? and * are allowed as wildcard characters for title.

status:=iCal Set calendar property(options)

options: Spepcify a calendar by its uid or title. Only the title and coler are modifiable.

status:=iCal Get calendar property(options)
status:=iCal Remove calendar(options)

options: Sepcify a calendar by its uid or title.

calendar properties
  • uid: read only TEXT
  • color: LONGINT (see below)
  • type: read only TEXT (ee below )
  • title: TEXT
  • subscribed: read only BOOLEAN
  • immutable: read only BOOLEAN
  • allowsContentModifications: read only BOOLEAN
  • notes: TEXT Deprecated (3.2.0)
  • isEditable: read only BOOLEAN Deprecated (3.2.0)

Notes

  • uid is mapped to calendarIdentifier
  • color seems to be “write only” for some calendars.
  • type can be Local, CalDAV, Exchange, Subscription, Birthday. “IMAP” is Deprecated (3.2.0)
status:=iCal Set event property(options)
status:=iCal Get event property(options)
status:=iCal Create event(options)
status:=iCal Remove event(options)
event properties
  • uid: read only TEXT
  • startDate: TEXT or DATE
  • endDate: TEXT or DATE
  • title: TEXT
  • location: TEXT
  • notes: TEXT
  • url: TEXT
  • calendar: OBJECT
  • timeZone: read only OBJECT
  • recurrenceRule: OBJECT
  • isAllDay: BOOLEAN
  • isDetached: read only BOOLEAN
  • occurrence: read only TEXT
  • creationDate: read only TEXT
  • dateStamp: read only TEXT
  • alarms[]: read only COLLECTION (see below)
  • attendees[]: read only COLLECTION (see below)

Notes

TODO: addAlarm:, removeAlarm:

it is not possible to add attendees with Event Kit

attendees

alarm properties
  • action: read only TEXT
  • emailAddress: read only TEXT
  • sound: read only TEXT
  • url: read only TEXT Deprecated (3.2.0)
  • relativeTrigger: read only REAL
  • absoluteTrigger: read only DATE

Notes

attendee properties
  • isCurrentUser: read only BOOL
  • role: read only TEXT
  • type: read only TEXT
  • status: read only TEXT
  • commonName: read only TEXT
  • address: read only TEXT

Notes

recurrenceRule properties
  • recurrenceInterval: LONGINT
  • firstDayOfTheWeek: LONGINT
  • recurrenceType: LONGINT
  • recurrenceEnd: OBJECT
  • recurrenceEnd.usesEndDate: read only BOOLEAN Deprecated (3.2.0)
  • recurrenceEnd.endDate: DATE
  • recurrenceEnd.occurrenceCount: LONGINT
  • dayOfTheWeek: LONGINT Deprecated (3.2.0)
  • weekOfTheMonth: LONGINT Deprecated (3.2.0)
  • daysOfTheWeek[]: COLLECTION of numbers
  • daysOfTheMonth[]: COLLECTION of numbers
  • nthWeekDaysOfTheMonth[]: read only COLLECTION of objects Deprecated (3.2.0)
  • monthsOfTheYear[]: COLLECTION of numbers
  • weeksOfTheYear[]: COLLECTION of numbers
  • daysOfTheYear[]: COLLECTION of numbers
  • setPositions[]: COLLECTION of numbers
status properties
  • success: BOOLEAN
  • error: OBJECT (if success is false)
  • error.code: LONGINT
  • error.localizedDescription: TEXT
  • error.localizedRecoverySuggestion: TEXT