Search code examples
javascriptnode.jsreact-nativecalendaricalendar

Sync Calendar Implementation


So I'm working on a react native app with a NodeJS backend where the user is in teams and each team has a calendar with possibly recurring events. I'm storing the events, individual event occurrences, and attendees in my DB. I'm trying to figure out how to allow users to sync their individual team & all teams calendars with Google Calendars, Outlook, Apple Calendars, etc using a link.

From my understanding that would require me to create an ICS file with a public URL that the calendar apps can read. However I have not been able to figure out how to create an ICS file and be able to edit it later to change details for a specific event in the ICS file in the case that a user adds more events/updates an existing one? Or is there another way that you guys are doing it like recreating the entire ICS file at intervals using a script?

I would assume that this a common use case but I've been struggling to find any good implementations or tutorials for this. I've looked at a bunch of packages like:

However, neither of them seemingly allow editing specific events in an existing ICS. Am I even looking in the right direction? What's the common way people create those "Subscribe to Calendar" or "Sync Calendar" functionalities?


Solution

  • Ended up just recreating the entire ICS every time a change is made