iCalendar : Fix Google Calendar Doesn't Sync
When develop application that generate a scheduling event, you might need to allow a user to subscribe the events in their own calendar app, could be apple calendar / windows calendar / google calendar or any other third party calendars.
The easiest way to implement event subscription was implementing icalendar protocol.
https://www.rfc-editor.org/rfc/rfc5545. After implementation completed, seems apple/windows calendar can be synced perfectly.
However, some users are reported that use google calendar integration isn't really synced with our endpoint, event though any other third party calendar integration working well.
Apple/Windows calendar doing the integration by calling our icalendar endpoint in fixed time span, it's configurable in their desktop/mobile app.
But there's no such option in Google Calendar, after do some research i found that Google Calendar crawler are rely on some properties that are missing from our existing iCalendar endpoint:
1. Sequence Number ( https://www.rfc-editor.org/rfc/rfc5545#section-3.8.7.4 )
Property Name: SEQUENCE Purpose: This property defines the revision sequence number of the calendar component within a sequence of revisions. Value Type: INTEGER Property Parameters: IANA and non-standard property parameters can be specified on this property.
Every time an event updated, we will need to increase a sequence of the ical event
2. Last Modified ( https://www.rfc-editor.org/rfc/rfc5545#section-3.8.7.3 )
Property Name: LAST-MODIFIED Purpose: This property specifies the date and time that the information associated with the calendar component was last revised in the calendar store. Note: This is analogous to the modification date and time for a file in the file system. Value Type: DATE-TIME Property Parameters: IANA and non-standard property parameters can be specified on this property.
We will also need to update the last modified based on event last timestamp.
That's all. Google Calendar perfectly synced with iCal endpoint after that.
Comments