Is there a way to modify my attendance status using iOS EventKit? - ios

I retrieve events from my calendar using Apple's EventKit
Now I have a list of my events with details. I'd like to choose a particular event and change my (and only my) attendance status (i.e from Maybe to Accept).
I can't see an obvious option for that. I can read:
"EventKit cannot add participants to an event nor change participant information." EkParticipant
"Attendees is read-only property" Attendees
Is there a way to do that?
I noticed the other approach with using EkEventEditViewController.
I'd like to avoid that if possible.
PS.
I saw these, but I thought they're kinda outdated:
How to accept/decline EKEvent invitation?
EKEvent accept event invtation
Adding EKParticipants to an EKEvent in EventKit

I just used EventKitUI and it works.

Related

How do you reliably find an iOS Calendar?

The calendarIdentifier property on EKCalendar says that a full sync will lose the identifier. How are we supposed to track a calendar then? It's not possible to just trust the name of the calendar because nothing prevents the user from changing the name. Not only that, nothing prevents two calendars from having the same name.
What I'm basically dealing with is that my Team object has an associated subscribed calendar, and I need a way to link those two together. The obvious solution is to store the calendarIdentifier in the Team object once it's created, but that won't work based on the documentation.

Add attendees to iCloud calendar event

I am using Event Kit to read and create events. I want to be able to add attendees to such events. But as described in documentation we cannod do that with Event Kit framework:
Event Kit provides limited access to a user’s Calendar database; it
does not include everything that would be desired for implementing a
full-featured calendar or reminder app, such as adding attendees or
accounts (Link to the source)
I see that some apps, like Google Calendar, can do that. I think that they are using CalDAV protocol, but I could not find anything about that (documentation, tutorials, other helpfull resources) and I don't know where to start.
Any help would be welcome.
Thanks
UPDATE:
Possible duplicate of:
Add participant to an event in iOS
Anyway, I will try to post here my research updates.

Add Invitees to calendar event programmatically iOS

I've been trying to look for the answer to this quite some time.
Apple EventKit documentation isn't allowing changing meeting invitees programmatically since those properties in an EKEvent are read-only.
I'm trying to find a way to create a calendar meeting (not necessary using EventKit), adding invitees to the meeting and setting it programatically.
Any solution will be great,
Thanks!
As you already figured out you cannot currently write meeting fields in iOS (AFAIK EventKit is the only API giving you access to the calendar database on iOS).
If you know what kind of account it is (and get the credentials from the user), you could sidetrack EventKit and directly create meetings on the server. Eg using EWS when the account is on Exchange or CalDAV when the account is on iCloud or Apple Calendar Server etc.
And finally you always have the option to send out meeting invites via iMIP. Though you would still need to get the event into the users calendar (so that replies have a target). Depends on your useless whether this is useful.

iOS: Create calendar with uneditable events?

From an app, is there a way to programmatically create a calendar with events that are uneditable? Or, what is the best way to achieve this as close as possible?
For example, Facebook events have a unique "Event Details" screen with their custom details. The user cannot edit the event from iCal, but instead have to click "View on Facebook".
1) I've explored creating local calendars and iCloud calendars but the user can easily edit the events and the calendars, including removing them, from iCal.
2) From the app, I cannot seem to create a new EKSource to have total control of the calendars I create in that source. Creating a new calendar in the existing CalDAV source also doesn't make it appear.
3) The EKCalendar class has an allowsContentModifications property, but it is readonly and cannot be modified.
Official response from Apple Developer Technical Support:
Our engineers have reviewed your request and have concluded that there
is no supported way to achieve the desired functionality given the
currently shipping system configurations.
So as of right now there isn't a way to do this.

How to programmatically access default alert time for calendar events?

In recent iOS versions, users may select a default alert time that will be used for all newly-created events (by going to Settings --> Mail, Contacts, Calendars --> Calendars / Default Alert Times, see http://www.imore.com/how-edit-calendar-defaults-alerts-and-sync-settings-iphone-and-ipad#calendar-alerts ).
I am looking through EventKit documentation and can't find a way to read this setting programmatically. I've tried creating a dummy event with [EKEvent eventWithEventStore:] and reading its alarms property, but it doesn't seem to have the default alarm set until I save the event. Of course, I could save the event, read its alarms property and then delete it right away, but it seems like an ugly solution.
What's the proper way to access this setting from code?

Resources