add-to-calendar-buttons icon indicating copy to clipboard operation
add-to-calendar-buttons copied to clipboard

iCal generated are not displayed on iOS

Open lidiotduvillage opened this issue 6 years ago • 11 comments

The invite is shown but hidden immediately. It works fine on https://www.addevent.com/ so there must be something broken.

lidiotduvillage avatar Jun 03 '18 17:06 lidiotduvillage

@lidiotduvillage The most likely reason for this problem is that your iPhone Calendar is getting synchronized with iCloud or another online calendar service and also that your iPhone is set to sync only the recent most events!

Because the startdate of the event in the exemple is in 2013 your phone doesn't synchronise it! To change it, go to Settings > Calendars > Sync ; here you should be able to see '1 month' as the default setting. You can click on this option to change it to 2 weeks, 1 month, 3 months or 6 months or you can also select All Events for syncing everything in your calendar.

Full details here : https://drfone.wondershare.com/iphone-problems/iphone-calendar-problems.html

davidlagace avatar Jun 21 '18 18:06 davidlagace

Thank you for your answer but It's not really helping, I can't ask people using my website to do that. It needs to be fixed in this app.

lidiotduvillage avatar Jun 22 '18 08:06 lidiotduvillage

Try removing the target parameter from the hyperlink.

123HPES321 avatar Jun 22 '18 15:06 123HPES321

Actually, I noticed that once I click the "add to calendar icon" it open the atc webpage and then ios ask "this website try to show you a calendar invitaion, allows ?"

If I click fast enough (before the webpage is fully loaded) then the invite is properly displayed and stay. But If I wait the end of the loading, then once I validate, the invite is shown and hidden immediately

lidiotduvillage avatar Jun 22 '18 15:06 lidiotduvillage

Same for me. If you remove target entirely you won’t get the prompt and it will just open.

123HPES321 avatar Jun 22 '18 15:06 123HPES321

Do you mean the <a target="" parameter ? added by atc script ?

lidiotduvillage avatar Jun 22 '18 15:06 lidiotduvillage

@lidiotduvillage see https://github.com/carlsednaoui/add-to-calendar-buttons/pull/28/files#diff-05d0073950a034e1c5a54e507a4d3e54L62

julienV avatar Jul 31 '18 17:07 julienV

Thank you but It does not change anything on my side. The issue occurs on iOS with Safari for instance

lidiotduvillage avatar Aug 01 '18 21:08 lidiotduvillage

You should replace the target="_blank" on the links with a "download" parameter (just "download", no value). That way, you force the .ics to download and it's shown properly on iOS.

damianvila avatar Aug 13 '18 11:08 damianvila

thank you a thousand times @damianvila that works perfectly ! you made my day

lidiotduvillage avatar Aug 24 '18 00:08 lidiotduvillage

Replace target="_blank" by download is a good solution but if you want to Safari (on Apple's device) open automatically the file you can replace https:// by webcal:// on the url of your file. In ouical.js replace

[...]
      var href = encodeURI(
        'data:text/calendar;charset=utf8,' + [
          'BEGIN:VCALENDAR',
          'VERSION:2.0',
          'BEGIN:VEVENT',
          'URL:' + document.URL,
[...] 

by

[...]
      var myURL     = document.URL;
      var myURL     = myURL.replace('https://', 'webcal://');
      var href          = encodeURI(
        'data:text/calendar;charset=utf8,' + [
          'BEGIN:VCALENDAR',
          'VERSION:2.0',
          'BEGIN:VEVENT',
          'URL:' + myURL,
[...] 

With target="_blank" Safari open .ics in iCalendar and with download Safari download .ics and open it.

adynemo avatar Sep 28 '18 11:09 adynemo