Skip to content

Add cross‑platform support for “Add to Google Calendar” button (Android/iOS/Desktop) #397

@mariobehling

Description

@mariobehling

Currently, webcal:// links do not work on Android. Users cannot easily subscribe to event calendars from the schedule page.

Possible Solution

Implement a lightweight JS solution or propose another option that works:

  • On iOS/macOS → opens webcal:// link (native Calendar subscription).
  • On Android → redirects to Google Calendar subscription: https://calendar.google.com/calendar/r?cid=<ENCODED_ICS_URL>.
  • On Desktop/other → shows a small menu with:
    • Google Calendar
    • Apple Calendar (webcal://)

Example Snippet

<button id="subscribeCalendar">Add to Calendar</button>
<script>
(function(){
  var ICS_URL = 'https://example.com/calendar.ics';
  var gcUrl = 'https://calendar.google.com/calendar/r?cid=' + encodeURIComponent(ICS_URL);
  var webcalUrl = 'webcal://' + ICS_URL.replace(/^https?:\/\//,'');
  var ua = navigator.userAgent.toLowerCase();
  if(/iphone|ipad|macintosh/.test(ua)) {
    window.location.href = webcalUrl;
  } else if(/android/.test(ua)) {
    window.location.href = gcUrl;
  } else {
    // Show menu with Google / Apple / Download links
  }
})();
</script>

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions