Importing .ics into an iOS app

768 views Asked by At

I am making an app that imports grades from a SIS (Student Information Service) known as PowerSchool. At first I thought that I would need to parse the HTML tags to get the information and organize it. I even found someone who had already successfully done so but I takes about 5 minutes to refresh, ruining the convenience of the app. Recently, I discovered that the site allows you to export all of the posted assignments into an .ics format and view them in iCal and other calendar programs. I believe that utilizing the .ics URLs would be the easiest and fastest way to import them into my app, but I don't know how to go about doing this. Could someone please point me in the right direction?

2

There are 2 answers

0
Emastmagy MastMagy On

I could be wrong but you can capture the click with

if (navigationType==UIWebViewNavigationTypeLinkClicked)
{
    //check if the link is .ics     
    if ([[[[[request URL] absoluteString] pathExtension] lowercaseString] isEqualToString:@"ics"])
    {

        // here you call a delegated method to UIDocumentInteractionController 
    }
} 

You should read up on UIDocumentInteractionController as well. The document is .pdf but you can also specify the UTI for calendar.

0
Emastmagy MastMagy On

Also with >= ios 4.2 you don't even need to specify UTI for calendar you can simple call the menu like this.

[documentController presentOpenInMenuFromRect:CGRectZero inView:[self view] animated: NO];