9

I am building the server side for a calendar application. The client side is iOS only. The original plan was the app will know of iCal event changes then tell the server. But that might be a problem with reminders (via Parse Push). For example, if the event pushed forward the reminder should come earlier.

Is it possible from the server side to be notified on iCal events? For example, when users create/update/delete an iCal event I want to know from a server to grab this information. Is this possible? Or does everything need to be done via a native app thats running?

My server is currently on parse.com. But I could use a separate server say NodeJS if needed.

Jiew Meng
  • 84,767
  • 185
  • 495
  • 805

4 Answers4

5

As iCal is user/device dependent, unless user has synced his calendar events with iCloud. And in second case where user has activated syncing of calendar events, it is completly insecure for end-user to share his icloud details to other server.

How about creating 1 API at backend, which will update/delete requests from Apps for the calendar events, and that will update Parse notification events in background process. For this you can also write customized Parse apis either in NodeJS or any other technology stack.

And in the apps, you can sync the events with iCal using Event Kit:

https://developer.apple.com/library/mac/documentation/DataManagement/Conceptual/EventKitProgGuide/ReadingAndWritingEvents.html#//apple_ref/doc/uid/TP40004775-SW1

Ankit Thakur
  • 4,739
  • 1
  • 19
  • 35
3

first, you need to able to let iOS wake up your app running in the background, that requires to classify your app to one of the mode stated in the Apple Background Execution, I think the "Background fetch" is appropriate in your case, then in your application:performFetchWithCompletionHandler: you could check the Calendar database for changed events and preform necessary updates to the server.

Allen
  • 6,505
  • 16
  • 19
  • This would allow the app to wake up and do a fetch or some background operations in the background, but the push notification that is received on the app need to be triggered from a server by a particular event. That event, ideally is a change in the user's iCal reminders / calendar events. Which unfortunately could happen without the custom / 3rd party app reading it via eventkit, and do a sync from the native Calendar app. – Jesse Armand Jan 07 '16 at 04:23
  • @JesseArmand the issue will be where to get the event change notification, there has apple's calendar change event you can subscribe to while your native iOS app is running in foreground, but it will not notify the background app, so that's why propose the background approach to check the calendar database periodically. – Allen Jan 10 '16 at 00:31
  • The background fetch needs to be triggered by something, it can't just run automatically like a cron job in a server environment. That trigger that I was referring to is necessary to make this happen. – Jesse Armand Jan 10 '16 at 09:30
1

I think this is your best bet: https://stackoverflow.com/a/23997912/1967872

In your implementation of the storeChanged: method mentioned in that answer, you should iterate through all the events, detect any changes and submit those to the server.

Community
  • 1
  • 1
Jacek Lampart
  • 1,741
  • 13
  • 25
0

I don't know exactly that is possible or not but I am thinking it's hard because still I didn't find any library/any features that apple is provides like that. But I am putting one link that might be helpful for you. Please check it.

http://kb.kerio.com/product/kerio-connect/os-x/support-for-apple-ical-calendar-using-the-caldav-standard-1494.html

iPatel
  • 46,010
  • 16
  • 115
  • 137