0

I've got the URL of an .ics file, and I'm looking to add it to the users calendar.

Others have suggested using [[UIApplication sharedApplication] openURL: icsURL], except this directs the user to Safari and they don't return.

Is it possible to display that popover inside my app, or another way to import events to the users calendar from an .ics file?

Josh Hunt
  • 14,225
  • 26
  • 79
  • 98

1 Answers1

0

You can parse the .ics file in your app, and add manually the events to the appropriate calendars as required. In order to do so, you need to download, compile and add libical to your source code. the library is written in C, you will need to carefully read the associate documentation and browse the included code examples. A little warning: it will take some time to master the library.

See this question for a snippet of code showing how to implement the parsing functionality.

Check out this answer it gives two alternative github projects that have code to parse ics files into Objective-C objects.

Community
  • 1
  • 1
Massimo Cafaro
  • 25,429
  • 15
  • 79
  • 93
  • Hmm, I was hoping EventKit or something would have a method of just adding an .ics file. In that case, it's me that's generating the .ICS files on a server, perhaps I'll send the events through in JSON or something so I can skip the libical stuff and just pop them straight in using EventKit. – Josh Hunt Jan 12 '14 at 23:43