1

I'm using the CalendarStore API to create tasks (CalTask items). My assumption is that by doing so these items would be automatically synced to iCloud (assuming the user has this setup in System Preferences). In fact, the CalendarStore docs say:

The Calendar Store database stores the local copies of records belonging to the Calendars schema. If MobileMe system preferences are configured to sync the Calendars schema, then your changes to these records, using the Calendar Store programming interface, are also synced.

But it seems that simply creating items in the CalendarStore doesn't trigger iCloud sync of them. I know my items are properly going into the CalendarStore, because I see the changes coming back (I observe CalTasksChangedNotification and CalTasksChangedExternallyNotification, and my changes are coming through there). But until I run iCal, no iCloud syncing occurs.

I don't think there's anything I'm doing wrong in my code. In fact, you can reproduce this with Apple's CalendarItems sample code. Creating tasks and events will not trigger CalendarStore sync until you run iCal.

Pre-iCloud, you used SyncServices to do this (nice article here on that), but I kinda thought this wasn't used with Lion and iCloud. In fact, I can't even find Apple's SyncServices docs.

I know it's possible to programmatically trigger CalendarStore syncing to iCloud, because other apps do this (I'm looking at you, Fantastical). Can anyone give me any pointers?

There are a couple similar questions, but they are pre-iCloud, and appear not to have been resolved.

Update: Though it appears to still work, I see Sync Services is officially deprecated in Lion. Is there really no replacement for it?

Community
  • 1
  • 1
zpasternack
  • 17,838
  • 2
  • 63
  • 81

0 Answers0