UIDocumentInteractionController unable to add ics file to calendar
Asked Answered
L

1

9

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

Liatrice answered 8/1, 2014 at 10:5 Comment(6)
Hi, just wondering if you've managed to solve this, as I'm running into the same problem too.Voluptuary
Nope. Although i did read that the Document Control never should have supported ICS files, and it working in previous versions was actually an undocumented feature. In the end we've had to park it as we can't seem to find an alternative.Liatrice
That's a shame. I've just written a bug report to Apple so hopefully something gets done about it. In the end I just used an EKEventEditViewController (I know this isn't available to you) though my client was happy with that. Have you considered emailing the .ics file, and then having the participants view that via email?Voluptuary
Yeh, thats kinda a last resort as it has a horrible User Flow to it.Liatrice
@Liatrice Total shot in the dark here, any chance you remember where you read that Document Control shouldn't support ics files? I've ran into pretty much the same issue and asked on here if it might be a permission issue. Haven't had much luck in my research as to why ics isn't supported by UIDocumentInteractionController (but vcf is)Straddle
Anyone found a solution already?Interceptor
M
0

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.

Menorca answered 24/11, 2015 at 17:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.