2

I want to create a file, that will be accessed by using the webcal:// protocol.

The final goal is to let the user subscribe to a shared calendar, and I know that this can be done in a million different ways, and that webcal has disadvantages, but please treat this question as a technical question about webcal and don't offer alternatives.

  1. What should be its content, if I want it to allow a user to subscribe to a shared calendar?
  2. How should I host such a file? Most of the servers I know support only http/s queries.

Thx!

A-S
  • 2,547
  • 2
  • 27
  • 37

1 Answers1

3
  1. Please refer to the RFC5545 shared calendar (ics)n specification https://www.rfc-editor.org/rfc/rfc5545 for the format of contents of the ics calendar files.

  2. Note that webcal is an unofficial apple protocol for ics calendar files. Google and other calendar providers use https for their shared calendars. These can be hosted on most servers. An ics url is literally just a file (or active url). If you persist in using webcal protocol only, some calendar applications may not accept so I strongly suggest the official 'alternative'.

From page 5 of the specification

"The iCalendar format is suitable as an exchange format between
applications or systems. The format is defined in terms of a MIME
content type. This will enable the object to be exchanged using
several transports, including but not limited to SMTP, HTTP,....."

Community
  • 1
  • 1
anmari
  • 3,830
  • 1
  • 15
  • 15
  • Thanks for your answers. As for the first answer, I couldn't find in the docs how to write an ICS file, that once downloaded and opened - offers the user to subscribe to a shared calendar. Can you point me in the right direction (I did read the specification you've sent me, and also searched for words like "Subscribe", etc.) – A-S Mar 16 '21 at 07:49
  • I would expect something like a "URL" parameter with "BEGIN:VSUBSCRIBE" or something like that. – A-S Mar 16 '21 at 07:58
  • 2
    The mime type of text/calendar is what tells a system that it is a ics calendar file. It is a text field just like any other text file. One does NOT download and open such a file as it then becomes static (ie will not update). One SUBSCRIBES to the URL. Any such rfc5545 compliant valid url can be subscribed to from any calendar application. Please try it yourself in your calendar apps. FOR example in google calendar, our family all share our calendars with each other and we have other utility calendars for booking the cars, family & friends birthdays etc. – anmari Mar 16 '21 at 08:03
  • How to subscribe https://help.practicebetter.io/hc/en-us/articles/115000669508-Linking-your-Apple-iCloud-Calendar-to-Google-Calendar. Some fun calendars to subscribe to for testing: https://www.makeuseof.com/tag/free-calendars-add-google-calendar/. My personal favourite is the eccentric holidays https://calendar.google.com/calendar/ical/0bajvp6gevochc6mtodvqcg9o0%40group.calendar.google.com/public/basic.ics – anmari Mar 16 '21 at 08:05
  • If you do not have strong programming skills, you may want to use a library to produce the ics file. EG: https://phpicalendar.net/ or https://icalendar.org/php-library.html. If your events are VERY simple, no recurrences or modifications, then you could getaway with simply writing the necessary text directly. Open the file, write to the file, close the file. – anmari Mar 16 '21 at 08:07
  • No, there is NO VSUBSCRIBE in the spec. I suggest you open an example .ics, maybe even your own from google calendar, in a text editor so you can see what's in it. Then do more research and testing yourself. It is the only way to really understand. – anmari Mar 16 '21 at 08:10