Mike S
Mike S

Reputation: 4122

iPhone Event Kit : programmatically SUBSCRIBE to a new calendar

I was lead to this answer and that tells us how to create an offline calendar (I think) but how do I subscribe to a URL on a server that is spitting out a calendar in ics format? Is this possible?

Upvotes: 2

Views: 2742

Answers (1)

gtmtg
gtmtg

Reputation: 3030

Why not use this: How to programmatically add calendar subscriptions on iOS?

Summarizing the accepted answer:

NSString *url = @"http://server/filename.ics";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];

Edit: Used this in my own app and verified that it works...

Edit by MitchR: For those generating their own ics feeds on the server, the url must end in .ics to receive the subscription prompt. The MIME type of the response must also be text/calendar. My server is a .NET/MVC server so I added a custom route so I could have the .ics on the end of the controller action.

Upvotes: 6

Related Questions