Hi all,
In my iPhone app, I have this button, that opens a webcal:// URL in a UIWebView as follows:
#define kHostName @"webcal://www.markthisdate.com/kalender/World_Cup_Football_2010_Match_Schedule_10251.ics"
- (IBAction)putInCalendar:(id)sender{
NSURL *url = NULL;
url = [[NSURL alloc] initWithString:kHostName];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL: url];
[webView loadRequest: request];
[request release];
[url release];
}
In iOS 3.x, this triggers a sequence of dialogs “Subscribe to calendar....” etc, similar to what happens if you would open the same URL in Mobile Safari: the associated event is added as a subscription to the iPhone's calendar.
Somehow, in iOS 4.0, this doesn't work from within my app, although opening the URL in Mobile Safari in iOS 4.0 DOES work.
Can anyone explain to me why this is not working, but even better: what would be the proper iOS 4.x approach to this functionality.
I had a look at the newly Event Kit that has been added to 4.0, because that seems to be dealing with these kind of things; the documentation on Event Kit however is pretty meager, and I haven't been able to find any sample projects using Event Kit.
Thank you so much for your insights!