How to programmatically access default alert time for calendar events? - ios

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?

Related

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

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.

iOS: Open a Calendar app New Event screen with populated date

Is it possible to redirect a user to Calendar app New Event screen programmatically with populated start and end dates? I am aware of Introduction to Calendars and Reminders, but that seems to be an overkill. I have also tried calshow://, but didn't seem to work either or I am couldn't find a correct scheme.

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.

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.

Google Sync the calendar on iOS

I am quite new to iOS, and I would appreciate if you can give me a clue on how to tackle this issue.
I am planning a mobile application and a cloud service to require "Google calendar is sync with the calendars on mobile devices" ( namely iPhone, iPad, and Android )
On Android, I can read calendar's event id from our Android app. If I change event attributes such as tile and time etc, the event id stays unchanged, and it seems to be a good way to associate our meta data to it (i.e. event id).
On iOS side, if I enable Google Sync, the events I defined on web still appear on the calendar on iOS. My question is "Can I problematically get event id that are assigned on Google Calendar?"
The following link says
"EKEvent's eventIdentifier is likely to be changed when event changes"
http://developer.apple.com/library/ios/#documentation/EventKit/Reference/EKEventClassRef/Reference/Reference.html#//apple_ref/occ/instm/EKEvent/eventIdentifier
... so my guess is that this field does not reflect event id from Google calendar.
I appreciate any suggestions.
Usually the event identifier is of the form:
88E45678-2S11-574E-ABF8-3B1E463ERF4C:google_calendar_id#google.com
for a google sync calendar event.
If there was a change made to one of the recurring calendar events the identifier can also have exception date at the end:
88E45678-2S11-574E-ABF8-3B1E463ERF4C:google_calendar_id#google.com<!ExceptionDate>20121025

Resources