UIDocumentInteractionController unable to add ics file to calendar

ぃ、小莉子 提交于 2019-12-03 12:57:47

问题


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

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

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

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'

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.

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

Any ideas would be great

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

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/20992426/uidocumentinteractioncontroller-unable-to-add-ics-file-to-calendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!