为什么我的.ics文件打开时未注册取消事件? [英] Why is my .ics file not registering a cancel event when it is opened?

查看:77
本文介绍了为什么我的.ics文件打开时未注册取消事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序以编程方式输出.ics文件来处理事件。最初确认事件后,通过电子邮件发送的初始.ics文件如下所示:

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:fake1@email.com
ATTENDEE;CN=Guest:mailto:fake2@email.com
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

这似乎还会随机提示Apple日历上的菜单,无论我是否要将事件添加到日历中。有时它会显示该提示,而其他时候则不显示。不确定为什么。

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.

无论如何,当事件取消时,我们然后发送第二个.ics文件:

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:fake1@email.com
ATTENDEE;CN=Guest:mailto:fake2@email.com
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

这并不会最终取消我的日历应用程序中的活动。不知道这是怎么回事。有人知道我在此ics文件中哪里出问题了吗?

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?

推荐答案

您的METHOD属性表示iTIP消息的类型是包含在VTIMEZONE定义中,因此客户端可能最终完全忽略了它。该方法应该出现在

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
...

而不是

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

取消。

当然可能还有其他问题。

There might be other issues of course.

这篇关于为什么我的.ics文件打开时未注册取消事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆