add-to-calendar-buttons
add-to-calendar-buttons copied to clipboard
iCal generated are not displayed on iOS
The invite is shown but hidden immediately. It works fine on https://www.addevent.com/ so there must be something broken.
@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
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.
Try removing the target parameter from the hyperlink.
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
Same for me. If you remove target entirely you won’t get the prompt and it will just open.
Do you mean the <a target="" parameter ? added by atc script ?
@lidiotduvillage see https://github.com/carlsednaoui/add-to-calendar-buttons/pull/28/files#diff-05d0073950a034e1c5a54e507a4d3e54L62
Thank you but It does not change anything on my side. The issue occurs on iOS with Safari for instance
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.
thank you a thousand times @damianvila that works perfectly ! you made my day
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.