本文介绍了如何以编程方式在iOS上添加日历订阅?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过iPhone的设置面板,您可以添加远程.ics日历格式的订阅。我有,可在应用内执行此操作(请参阅下面的屏幕截图,abonneren op de agenda是指订阅日历),但也必须有其他人。



我想模仿这个行为,但我找不到API来做到这一点。它看起来像不是EventKit的一部分,但因为没有应用程序切换正在打订阅在示例应用程序,我怀疑它也不是一个url方案。



谁知道?




解决方案

尝试如下:

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

这将向用户显示一个uialertview问题,如果他/她想订阅。 >

;)


Via the settings panel of your iPhone, you can add a subscription to a remote .ics calendar format. I have a Dutch iPhone app that does this from within the app (see the screenshot below, "abonneren op de agenda" means "subscribe to the calendar"), but there must be others too.

I want to mimic this behavior for a project of mine, but I can't find the API to do this with. It looks like it's not a part of EventKit, but because there's no app switching going on when you hit 'subscribe' in the example app I suspect it's also not a url scheme.

Who knows?

解决方案

Try something like this:

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

This shows an uialertview with the question to the user if he/she wants to subscribe.

;)

这篇关于如何以编程方式在iOS上添加日历订阅?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 11:59