14

I've used the last couple of days creating an application that constructs an .ics file (ical)

It's coded in php, and the base functions work fine (timezones, Vevent's, and so on) but when i add VALARM's into those VEVENT's neither google calendar, nor Outlook 2010 add's the nofifications to their calendar's

a snippet of the ics file:

BEGIN:VEVENT
UID:f2f5672145d92702c71504ceccf77167@dyndns.org
DTSTAMP:20120420T174122Z
DTSTART;TZID=Europe/Berlin:20120416T081000
DTEND;TZID=Europe/Berlin:20120416T091000
LOCATION:A102 - Teori Frh.
SUMMARY:Hold: 2.B Kemi B
DESCRIPTION:Lærer: Jeppe Byrialsen Jensen (JBJ) Noter: Lab øvelser om alkoholers blandbarhed
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Hold: 2.B Kemi B
TRIGGER:-P0DT0H30M0S
END:VALARM
END:VEVENT

EDIT: It seems to work if you import it from a file, but sadly i need to import it from a website.

Delusional Logic
  • 808
  • 10
  • 32

6 Answers6

7

We had the same problem, but found that example code snippets which use \n at the end of each line need to use \r\n instead.

The iCal validator at http://severinghaus.org/projects/icv/ highlighted this as a warning, despite the iCal files working except for the reminder alarm not being set in Outlook 2010.

Here is an example iCal file which works exactly as expected when opened in Outlook 2010, including setting the reminder to 1 hour (as long as the line breaks are \r\n):

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Keeble Smith//NONSGML GETONCOURT.COM//EN
BEGIN:VEVENT
DTSTART:20130514T190000Z
DTEND:20130514T194000Z
LOCATION:Court 2\, Demo Squash Club
DESCRIPTION:View this court booking on getoncourt.com: http://democlub.getoncourt.com/booking-details/dmo3106
SUMMARY:Squash court booking for John Smith - DMO3106
BEGIN:VALARM
TRIGGER:-PT60M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR

Note also the escaped special characters. Ensure you escape the following in TEXT values (not the EOL instance though):

\  to  \\
;  to  \;
,  to  \,
\n to  \\n
Chris
  • 3,210
  • 1
  • 33
  • 35
  • 1
    VALARM parts are still ignored by Outlook and Google Calendar. It works with iPhone's Calendar. – Michał Aug 30 '13 at 10:32
  • Have you checked the EOL characters as mentioned in the answer? – Chris Aug 30 '13 at 14:31
  • Yes, \r\n's in each line. It seems that Google decided to ignore alarms, which is still compliant with [iCal's RFC](http://tools.ietf.org/html/rfc5545#page-75): "Note: Implementations should carefully consider whether they accept alarm components from untrusted sources, e.g., when importing calendar objects from external sources. One reasonable policy is to always ignore alarm components that the calendar user has not set herself, or at least ask for confirmation in such a case." – Michał Sep 16 '13 at 08:39
  • Has this been confirmed by Google? Is there any official statement from Google? (I did not find any...) – TomS Dec 13 '13 at 13:10
  • I have not seen any, but that's what it looks like to me. It's not that big of a problem, if you're using an auto-generated calendar, which has the same reminders for all events, because you can set a default reminder on Google imported calendars as well. – Michał Dec 16 '13 at 17:46
  • I can confirm what Mike points out: Both Outlook 2013 and Google seem to ignore VALARM regardless of EOL. – nurikabe May 19 '14 at 23:43
2

I'm having the same problem. I exported my calendars created in Google Calendar and the VALARM section looks exactly the same as those I exported. I have a feeling it's an issue on Google's side. I've seen this questions asked 2 or 3 more times on Stack Overflow without an answer.

Brandon
  • 166
  • 5
  • I had that feeling sadly. I haven't been able to get a hold of google, but it's really annoying me. From what i have read on the internet, MS outlook 2010 has the same problem. – Delusional Logic Apr 28 '12 at 18:13
1

could you clarify what you mean by "not registering". For instance I copied your code and imported it in google calendar and it clearly shows Reminder : pop-up 30mn in the property of the event.

Is it that you expect to see an item in the calendar where the alarm should take place. I believe this is not what the RFC5545 implies as a behaviour for VALARM.

Auberon Vacher
  • 4,655
  • 1
  • 24
  • 36
  • You got the alarm? How. i've been trying to do this for a little over a month, and have not yet succeeded. – Delusional Logic May 10 '12 at 16:22
  • It seems that it works if you import it from a file, but not if you import it from a website (which is what i need). Most peculiar – Delusional Logic May 10 '12 at 16:29
  • It most definitively is a bug from google calendar: the same event when imported as a file shows the reminder but when imported from URL it does not. One could assume it is a difference between "personal calendars" and "others calendars" but even if the event is "moved" from "others calendar" to "my calendar" the event has "lost" its reminders. – Auberon Vacher May 14 '12 at 06:47
  • It is very strange, i'm gonna have to contact Google on this one. i can't see any logical reason why alarms aren't allowed on websites. – Delusional Logic May 14 '12 at 15:18
1

MS states that Outlook ignores several of the standard alarm settings, see: http://msdn.microsoft.com/en-us/library/ee624781(v=exchg.80).aspx

I found this not to be the case in Outlook 2013. I removed:

ACTION:DISPLAY DESCRIPTION:Reminder

and the alarm works for me in Outlook 2013.

Appears to be a case of MS Outlook not following the RFC5545 standard, nor following their own implementation standard.

Klompenrunner
  • 723
  • 7
  • 13
0

For what it's worth, this is not a bug, per se, but rather a choice the calendar implementers choose that is compatible with the RFC. See http://sourceforge.net/p/dday-ical/discussion/656447/thread/01111137#23c5

I think the fear is that if the action is audio, then the client has to run the attached file (presumably a sound file) when the trigger event occurs. There's no guarantee, though, that the sound file is really a sound file and not something more nefarious.

Now, why it ignores valarms with the action of display, I do not know.

Jay Eckles
  • 103
  • 6
0

If someone still got problem with this. Ics with alarm 15 min before event. Tested in outlook 2013.

BEGIN:VCALENDAR
PRODID:-//MyTestProject//EN
VERSION:2.0
BEGIN:VEVENT
SUMMARY;LANGUAGE=sv-se:Room
UID:1af3ef4f-5997-4cf0-bde2-1f8705cfaef1
SEQUENCE:0
BEGIN:VALARM
TRIGGER:-PT15M
DESCRIPTION:Booking
ACTION:DISPLAY
END:VALARM  
CLASS:PUBLIC
DTSTAMP:20190221T132418
DTSTART:20190423T104000
DTEND:20190423T111000  
LOCATION:USA
END:VEVENT
END:VCALENDAR

Also some c# code for reference. DateTime etc.

var icalStringbuilder = new StringBuilder();
    icalStringbuilder.AppendLine("BEGIN:VCALENDAR");
    icalStringbuilder.AppendLine("PRODID:-//MyTestProject//EN");
    icalStringbuilder.AppendLine("VERSION:2.0");

    icalStringbuilder.AppendLine("BEGIN:VEVENT");
    icalStringbuilder.AppendLine("SUMMARY;LANGUAGE=sv-se:Room");
    icalStringbuilder.AppendLine("UID:" + Guid.NewGuid());
    icalStringbuilder.AppendLine("SEQUENCE:0");
    icalStringbuilder.AppendLine("BEGIN:VALARM");
    icalStringbuilder.AppendLine("TRIGGER:-PT15M");
    icalStringbuilder.AppendLine("DESCRIPTION:Booking");
    icalStringbuilder.AppendLine("ACTION:DISPLAY");
    icalStringbuilder.AppendLine("END:VALARM");
    icalStringbuilder.AppendLine("CLASS:PUBLIC");
    icalStringbuilder.AppendLine($"DTSTAMP:{DateTime.UtcNow:yyyyMMddTHHmmss}");
    icalStringbuilder.AppendLine($"DTSTART:{starttimeDataTimeFormatVariable:yyyyMMddTHHmmss}");
    icalStringbuilder.AppendLine($"DTEND:{endtimeDataTimeFormatVariable:yyyyMMddTHHmmss}");
    icalStringbuilder.AppendLine("LOCATION:USA");
    icalStringbuilder.AppendLine("END:VEVENT");
    icalStringbuilder.AppendLine("END:VCALENDAR");
kuken
  • 59
  • 9