Ios 从应用程序内部订阅日历

Ios 从应用程序内部订阅日历,ios,objective-c,ios7,eventkit,ekeventkit,Ios,Objective C,Ios7,Eventkit,Ekeventkit,我想向我的应用程序添加功能,以便用户能够订阅在线日历。 我以前是通过打开日历的url来实现的,这会导致iOS询问用户是否想要订阅此日历。 这种方式在完成时不会给我任何通知,并且提供了糟糕的用户体验 有更好的办法吗? 我正在查看EventKit和EKCalendarTypeSubscription,但找不到我需要的信息 我是否可以使用EventKit让用户在我的ftp服务器上订阅.ics日历,并知道用户是否已订阅此日历?您可以使用openURL方法,并侦听EKEventStoreChangedNo

我想向我的应用程序添加功能,以便用户能够订阅在线日历。 我以前是通过打开日历的url来实现的,这会导致iOS询问用户是否想要订阅此日历。 这种方式在完成时不会给我任何通知,并且提供了糟糕的用户体验

有更好的办法吗? 我正在查看EventKit和EKCalendarTypeSubscription,但找不到我需要的信息


我是否可以使用EventKit让用户在我的ftp服务器上订阅.ics日历,并知道用户是否已订阅此日历?

您可以使用
openURL
方法,并侦听
EKEventStoreChangedNotification
通知

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"]];
当用户单击UIAlertView中的Subscribe按钮时,将调用
storedChanged:


要检查用户以前是否订阅过日历,请检查
EKEventStore
上的
calendars
属性

您可以使用
openURL
方法,监听
EKEventStoreChangedNotification
通知

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"]];
当用户单击UIAlertView中的Subscribe按钮时,将调用
storedChanged:


要检查用户以前是否订阅过日历,请检查
EKEventStore
上的
calendars
属性

请查看此链接,@karthika此链接未提及订阅外部日历…:/请查看此链接,@karthika此链接未提及订阅外部日历…:/回答得很好。非常感谢。回答得很好。非常感谢。