将数据存储在“自定义字段"中或将附件存储在ics iCal文件中 [英] Store data in Custom Fields or attachment in ics iCal file

查看:136
本文介绍了将数据存储在“自定义字段"中或将附件存储在ics iCal文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为手动构建的iCal文件(.ics)提供一些其他信息,而这些信息我实际上我不想让Calendar应用程序用户看到.因此,我需要能够在iOS应用程序中创建事件并(随后)从Calendar事件中读取它们时手动设置它们.

I need to give my manually built iCal file (.ics) some additional infos which I actually don't want to be visible for Calendar app users. Thus I need to be able to set them manually when creating an Event in an iOS application and (later) reading them from the Calendar events.

我想知道是否可以向iCal/.ics文件本身添加自定义字段/属性(而不是通过使用日历应用程序!).它们不会显示在Calendar应用程序中,但作为我的移动应用程序开发人员可以在设备上从日历中读取ID,引用和其他内容时进行访问...直到现在,唯一的可能性似乎是存储这些值作为说明/笔记,但我对此绝对不满意!有任何可能性吗?现在,我既无法实现它,也无法在互联网上找到任何有用的东西...

I was wondering whether it is possible to add custom fields / attributes to a iCal / .ics file itself (not by using a calendar application!). They shall not be displayed in a Calendar application but accessible for me as a mobile app developer to store IDs, references, anything when I read them out from a calendar on the device... Until now the only possibility seems to be storing those vales as description / notes, but I'm definitely not happy with that! Is there any possibilltity? Neither could I achieve it by now nor did I find anything useful on the internet...

作为替代方案,我正在考虑使用iCal的附件功能,不幸的是,该功能仅对受邀人员和组织者本人可见,并且在编辑时可能无法编辑/更新.

As an alternative, I was thinking about using the Attachment function of iCal, which - unfortunately - is visible for invited persons and the organizer himself and may not be editable / updated when edited...

提前谢谢!

以下:ics示例日期

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Apple Inc.//Mac OS X 10.12.2//EN
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
DTSTART:19810329T020000
TZNAME:MESZ
TZOFFSETTO:+0200
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
DTSTART:19961027T030000
TZNAME:MEZ
TZOFFSETTO:+0100
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20170330T114118Z
UID:38F0C7FE-9711-437F-A5FE-E670E97C6766
DTEND;TZID=Europe/Berlin:20170330T160000
TRANSP:OPAQUE
ATTENDEE;CN="John Doe";CUTYPE=INDIVIDUAL;EMAIL="john@doe.de";PAR
 TSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:john@doe.de
X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC
SUMMARY:iCal Test100

CUSTOM:*** WHAT I WOULD NEED ***

DTSTART;TZID=Europe/Berlin:20170330T153000
DTSTAMP:20170330T114208Z
ORGANIZER;CN="Jon Doh":mailto:Jon@Doh.de
SEQUENCE:0
END:VEVENT
END:VCALENDAR

推荐答案

您可以定义自己的属性和参数.只要确保它们以"X-"开头即可.例如:

You can define your own properties and parameters. Just make sure they start with "X-". For example:

BEGIN:VEVENT
UID;X-FOO=bar:38F0C7FE-9711-437F-A5FE-E670E97C6766
X-SUPER-SECRET:abc123
...
END:VEVENT

这篇关于将数据存储在“自定义字段"中或将附件存储在ics iCal文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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