dtoka218420 2014-05-08 16:33
浏览 35
已采纳

iCalendar订阅无效

I seem to be having issues making iCalendar subscriptions work. My url looks something like https://somehost.com/calendar/list_events?calendar_id=500, and when visiting this URL in the browser I'm able to download the .ics file which imports properly into a few calendar applications. My problem is that attempting to subscribe to this same URL, I'm never able to import the events.

Here is what my PHP headers are set to:

header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename=calendar.ics');

And here is a sample of the attachment (but as I already mentioned, saving the file locally and then importing it works just fine):

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//AUTHOR//COMPANY//NONSGML 1.0//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
SUMMARY:A new event
DESCRIPTION:
DTSTAMP:20140508T162355Z
DTSTART:20140512T162355Z
DTEND:20140512T162355Z
END:VEVENT
END:VCALENDAR

I can only assume that I'm missing a piece of information, can anybody point out where I've gone wrong?

  • 写回答

1条回答 默认 最新

  • dougan1205 2014-05-08 18:49
    关注

    The UID property is required.

    Check our https://sabre.io/vobject for a iCalendar parser and generator. There's also a command-line utility that validates iCalendar objects for you.

    (note: shameless self-promotion).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题