URL Scheme to Trigger Calendar Client
Asked Answered
G

2

20

I have a website that generates dynamic calendar (icalendar). Lets assume that this calendar is accessible over HTTP at a URL like this

http://www.example.com/cal?q=<user query>

Everything works fine so far.

Now I want to let the users subscribe to this calendar with their favourite calendar client. For ios I can achieve this if I publish the calendar URL with the webcal:// URL scheme.

  1. Is there an equivalent URL scheme for Android ?
  2. Can I let the user import this calendar into his Google calendar ?
  3. Are there any other options that I didn't think about ?

Thank you

Grogshop answered 13/9, 2012 at 5:23 Comment(1)
The 'standard' for calendar files is a http/s url .ics with mime type text/calendar. Webcal is just apple doing their own thing. All calendar applications should accept the open standard.Karilla
K
4

If you specifically want to support importing to Google Calendar, you can construct a link to the google calendar website with the webcal url as a uri encoded query param. Here's what constructing that link looks like in JS:

"https://calendar.google.com/calendar/r?cid=" + encodeURIComponent("webcal://www.example.com/cal/whatever-the-link-is")

The downside to this is that there's (as of this writing) no mobile friendly version of the Google Calendar website that supports this feature, so the user will get this very non mobile friendly looking page:

enter image description here

And of course, this will method will not work for users who don't use Google Calendar. For them, it might be best to just provide them with a webcal link for them to import manually.

Kila answered 15/6, 2023 at 3:54 Comment(0)
K
3

Since this is showing as unanswered, with upvotes on the question, I'm making my comment a more formal answer:

  1. The 'standard' for calendar files is a http/s url .ics with mime type text/calendar. Webcal is just apple doing their own thing. All calendar applications should accept the open standard

  2. Yes, if your url is publicly accessible, they can subscribe to it. Alternatively they can do a once off import

  3. The RFC 5545 standard is the way to go for calendars and events https://www.rfc-editor.org/rfc/rfc5545#section-8.1

Karilla answered 12/2, 2020 at 7:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.