尽管验证成功,但Google Calender不会加载从iCal-URL导入的事件

时间:2019-04-01 10:28:57

标签: php calendar gmail icalendar

我目前在使用“导入网址”选项将数据导出到Google Calender时遇到一些问题。我的iCal格式如下(出于隐私目的,我已经隐藏了一些信息:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:<-//maskedforprivacy//maskedforprivacy//NL>
X-WR-CALNAME: maskedforprivacy
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Europe/Amsterdam
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19810329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19961027T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
TZNAME:CET
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:20190401T101550-1143242585-maskedforprivacy
DTSTAMP:20190401T101550
DTSTART;TZID=Europe/Amsterdam:20190104T080000
DTEND;TZID=Europe/Amsterdam:20190104T170000
SUMMARY: ZLU 60 jaar - Medewerker op- en afbouw
LOCATION: maskedforprivacy - Europaplein - 
END:VEVENT
BEGIN:VEVENT
UID:20190401T101550-1227247949-maskedforprivacy
DTSTAMP:20190401T101550
DTSTART;TZID=Europe/Amsterdam:20190105T160000
DTEND;TZID=Europe/Amsterdam:20190105T220000
SUMMARY: Nieuwjaarsconcert - Duty Manager
LOCATION: maskedforprivacy - Klinkertstraat - 
END:VEVENT
BEGIN:VEVENT
UID:20190401T101550-698202101-maskedforprivacy
DTSTAMP:20190401T101550
DTSTART;TZID=Europe/Amsterdam:20190206T090000
DTEND;TZID=Europe/Amsterdam:20190206T101500
SUMMARY: Levering maaltijden - Medewerker logistiek
LOCATION: maskedforprivacy - Wiebachstraat - 
END:VEVENT
BEGIN:VEVENT
UID:20190401T101550-549715553-maskedforprivacy
DTSTAMP:20190401T101550
DTSTART;TZID=Europe/Amsterdam:20000101T120000
DTEND;TZID=Europe/Amsterdam:20000101T130000
SUMMARY: Standaard documenten - Partymanager
LOCATION: maskedforprivacy - Klinkertstraat - 
END:VEVENT
END:VCALENDAR

我尝试使用以下标头将其导出:

header("Content-Type: text/calendar");
header("Content-Disposition: inline; filename=EPCalender.ics");

使用https://icalendar.org/validator.html#results验证格式将返回成功,而不会发出任何警告。使用Outlook中的URL导入iCal可以正常工作。我是否没有正确设置任何属性,以使Google Calender拒绝导入事件?

感谢前进!

1 个答案:

答案 0 :(得分:0)

1)我使用Content-Disposition:附件;用于我可订阅的ics网址。
2)注意:“按url添加”是订阅,而不是导入。导入是一次过的活动,如果已登录,则该活动可能会在非公共url上起作用。要订阅,该URL必须公开可用,而无需登录。