Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
486 views
in Technique[技术] by (71.8m points)

php - Ical VALARM not registrering

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:[email protected]
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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

We had the same problem, but found that example code snippets which use at the end of each line need to use 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 ):

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  ,

 to  \n

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...