UIDocumentInteractionController无法将ics文件添加到日历 [英] UIDocumentInteractionController unable to add ics file to calendar

查看:143
本文介绍了UIDocumentInteractionController无法将ics文件添加到日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 iOS应用程序中打开一个ics( Calendar )文件。

I am trying to open an ics (Calendar) file within my iOS application.

出于调试目的,我已将i ics文件添加到我在iCal中创建的日历事件包中。

For debug purposes i have added a ics file to my bundle of a calendar event created within iCal.

我正在使用 UIDocumentInteractionController 显示日历邀请的数据,希望让用户将其添加到日历中。

I am using UIDocumentInteractionController to present the data of the calendar invite with the hope of letting the user add it to their calendar.

但是在使用inics作为源文件呈现 UIDocumentInteractionController ,它正确显示与该事件相关的所有数据,但按钮'添加到日历'被替换为'此邀请数据已过期'

However on presenting the UIDocumentInteractionController with in ics as the source file, it correctly shows all the data related to the event, however the button 'add to calendar' is replaced with 'This invitation data is out of date'

如果我使用共享选项发送文件通过短信或电子邮件,然后尝试打开它,它使用 UIDocumentInteractionController 按预期工作,因此我不认为它是一个损坏的文件。

If i use the share option to send the file via SMS or Email and then try to open it, it works as expected using the UIDocumentInteractionController, therefore i don't think its an corrupt file.

我想知道我是否错过了一些简单的 UIDocumentInteractionController 或者这是一个已知问题。

I was wondering if i am missing something simple with the UIDocumentInteractionController or if this a known issue.

任何想法都会很棒

self.documentController = [UIDocumentInteractionController
                               interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];

self.documentController.delegate = self;
[self.documentController presentPreviewAnimated:YES];

编辑:我不能使用EKEvents,因为我需要将邀请者添加到活动中

I cannot use EKEvents as i need to add invitees to the event

推荐答案

这可能与您的问题无关,可能没有解释,但是一名员工遇到问题,他的iPhone不一致地接受ICS日历邀请,并且正在接收这个邀请数据是过时的消息,当它不起作用。经过多次尝试尝试和错误,结果是如果iPhone连接到wifi,它将给出此邀请数据已过期的消息。如果它仅连接到电话运营商网络,它将成功添加该事件。

This may be irrelevant to your issue and probably explains nothing, but an employee was having an issue with his iPhone inconsistently accepting ICS calendar invites and was receiving "this invitation data is out of date" messages when it would not work. After multiple attempts of trial and error, the result was that if the iPhone was connected to wifi, it would give the "this invitation data is out of date" message. If it was connected only to the phone carrier network, it would successfully add the event.

这篇关于UIDocumentInteractionController无法将ics文件添加到日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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