You could use the openURL
approach and listen for the EKEventStoreChangedNotification
notification.
self.eventStore = [[EKEventStore alloc] init];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(storeChanged:)
name:EKEventStoreChangedNotification object:self.eventStore];
// Prompt the to subscribe to the calendar
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://domain/path/to/cal.ics"]];
When the user clicks the Subscribe button in the UIAlertView, storedChanged:
will be called.
To check whether a user has previously subscribed to the calendar or not, check the calendars
property on EKEventStore
.