Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL Scheme to Trigger Calendar Client

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

like image 636
Gilad Avatar asked Nov 30 '25 00:11

Gilad


1 Answers

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.

like image 123
Jemar Jones Avatar answered Dec 02 '25 14:12

Jemar Jones



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!