Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my .ics file not registering a cancel event when it is opened?

Our application programmatically spits out an .ics file for events. This is what the initial .ics file that gets emailed out looks like, when an event is originally confirmed:

BEGIN:VCALENDAR
BEGIN:VTIMEZONE
METHOD:REQUEST
TZID:America/New_York
TZURL:http://tzurl.org/zoneinfo-outlook/America/New_York
X-LIC-LOCATION:America/New_York
END:VTIMEZONE
BEGIN:VEVENT
UID:test-7-oct-24-2016-uid
DTSTAMP:20161024T181901
ORGANIZER;CN=Host:mailto:[email protected]
ATTENDEE;CN=Guest:mailto:[email protected]
DTSTART;TZID=America/New_York:20170103T073000
DTEND;TZID=America/New_York:20170103T093000
SUMMARY:Insert random summary
GEO:0;0
DESCRIPTION:Random event
LOCATION:Random Location
SEQUENCE: 0
STATUS: CONFIRMED
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

This also seems to randomly prompt a menu on Apple's calendar whether or not I want to add the event to my calendar. Sometimes it shows that prompt, other times it doesn't. Not exactly sure why that is.

Anyway, we then send out the 2nd .ics file when the event is cancelled:

BEGIN:VCALENDAR
BEGIN:VTIMEZONE
METHOD:CANCEL
TZID:America/New_York
TZURL:http://tzurl.org/zoneinfo-outlook/America/New_York
X-LIC-LOCATION:America/New_York
END:VTIMEZONE
BEGIN:VEVENT
UID:test-7-oct-24-2016-uid
DTSTAMP:20161024T181901
ORGANIZER;CN=Host:mailto:[email protected]
ATTENDEE;CN=Guest:mailto:[email protected]
DTSTART;TZID=America/New_York:20170103T073000
DTEND;TZID=America/New_York:20170103T093000
SUMMARY:Insert random summary
GEO:0;0
DESCRIPTION:Random event
LOCATION:Random Location
SEQUENCE: 1
STATUS: CANCELLED
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

This doesn't end up cancelling the event in my calendar app. Not sure what's going on here. Does anyone know where I'm going wrong in this ics file?

like image 538
roonie Avatar asked Nov 16 '25 11:11

roonie


1 Answers

Your METHOD property which indicates the type of iTIP message is included in the VTIMEZONE definition so it probably ends up being totally ignored by the client. The METHOD should appear before the VTIMEZONE.

In other words, you should have:

BEGIN:VCALENDAR
METHOD:REQUEST
BEGIN:VTIMEZONE
...

instead of

BEGIN:VCALENDAR
BEGIN:VTIMEZONE
METHOD:REQUEST
...

This is also true for your CANCEL.

There might be other issues of course.

like image 71
Arnaud Quillaud Avatar answered Nov 19 '25 10:11

Arnaud Quillaud



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!