One click url for importing webcal to google/outlook calendar

2.5k Views Asked by At

I have a php app that serve as a webcal server, I want user can choose either use their calendar app, or just import the webcal://example.ics directly to google or outlook or office 365 calendar with one click url, without user going through settings to import. Tried to find documents on these but couldn't.

1

There are 1 best solutions below

0
On

YZY, There isn't a way that you can control the users calendar application to just import. It is up to the receiving end - the users application, to say how an ics file or url is treated on receipt. For example, in my desktop browser i have the default application for a .ics url/file set to be notepad++, not my calendar app. There is nothing you can do to override that.

How other applications such as email applications on smartphone or desktop treat it will depend on their settings as controlled by the user. EG: In outlook users may have unticked the 'automatically process meeting requests'

The only control the provider of the ics url/file has is to ensure that the file/url is specified correctly as per the latest specification (Note RFC5546 updates RFC5545, one needs to read both). Briefly:

  1. https protocol is standard (webcal is unofficial apple. See https://icalendar.org/iCalendar-RFC-5545/1-introduction.html, https://en.wikipedia.org/wiki/ICalendar.)
  2. The suffix is '.ics' as per examples given in RFC5546 and RFC5545
  3. The mime content type is text/calendar https://www.iana.org/assignments/media-types/text/calendar and https://datatracker.ietf.org/doc/html/rfc5545#section-8.1
  4. The appropriate METHOD must be used: PUBLISH is suitable for a subscribable URL (where it appears as a separate calendar in the URL) OR REQUEST (for meeting requests in emails etc) See https://datatracker.ietf.org/doc/html/rfc5545#section-3.7.2 and https://datatracker.ietf.org/doc/html/rfc5546#section-7.2

I like to distinguish between 'import' and 'subscribe':

  • Import in my opinion is where one imports an event (or multiple events) from a .ics file INTO an existing chosen calendar - eg (but not only): when a METHOD:REQUEST is used.
  • Subscribe is for icalendar feeds that get updated and so it is practical to subscribe or add the calendar by url to one's calendar application. This kind of url needs to be publicly accessible (although it can be obscured by unusual url)

One could download a subscribeable .ics and 'import' it but then one would only ever have that frozen event/s as at that point in time, it would not ever update.

In summary the best you can do is provide the url correctly and offer some links to info on how to subscribe in case the users are unfamiliar with subscribing