Skip to content
levching edited this page Apr 15, 2020 · 5 revisions

Create a new event with the ISN_EKEventStore.Instance.SaveEvent() method of the ISN_EKEventStore class.

You can set some of the details include:

  • The event’s title with the title .

  • The event’s start and end dates with the startDate and endDate parameters.+

  • The alarm associated with the event with the alarm parameter.

  • The event’s recurrence rule, if it is a repeating event, with the recurrenceRules parameter.

To add alarm parameter to your event you need to create new ISN_EKAlarmDataRequest and set there dueDate or timeStamp like this for example:

ISN_AlarmDataRequest alarm = new ISN_AlarmDataRequest(System.DateTime.Now);

To add recurrenceRules parameter to your event you need to create new ISN_EKRecurrenceRuleRequest and set there frequency and interval also you can set endDate like this for example:

ISN_RecurrenceRuleRequest recurrenceRule = new ISN_RecurrenceRuleRequest(ISN_RecurrenceFrequencies.Monthly, 2);

Next to save event you need to call ISN_EKEventStore.Instance.SaveEvent() method:

EKEventStore.Instance.SaveEvent("Test event", System.DateTime.Now, System.DateTime.Now, alarm, recurrenceRule, (request)=>
{
    if(request.Result.IsSucceeded)
    {
       Debug.Log(Yey, It's working! ID is - " + request.Identifier);
    }
    else
    {
        Debug.Log("We have error - "+ request.Result.Error.FullMessage);
    }
});

This request will return ISN_EKSaveResult object that contains Identifier of created event or error. You can use this Identifier for removing this event, to do this you need to call EKEventStore.Instance.RemoveEvent() method like this:

About

Foundation

AV Foundation

App Tracking Transparency

Game Kit

Store Kit

UI Kit

Social

Replay Kit

Contacts

AVKit

Photos

App Delegate

User Notifications

MediaPlayer

Core Location

AdSupport

EventKit

CloudKit

Authentication Services

XCode

Knowledge Base

Clone this wiki locally