如果用户使用非iOS帐户,则以编程方式将新日历添加到日历应用程序 [英] Adding a new calendar programatically to calendar app if user is using non iOS account

查看:112
本文介绍了如果用户使用非iOS帐户,则以编程方式将新日历添加到日历应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户使用任何其他帐户登录yahoo或hotmail这样的日历,我们可以以编程方式将新日历添加到默认日历应用程序吗?我收到以下错误

Can we add a new calendar to default calendar app programatically if user is using any other account for calendars like yahoo or hotmail , i am getting Following error

Domain = EKErrorDomain Code = 17该帐户不允许添加或删除日历。

如果用户使用,代码完全正常icould或ios日历

Code works perfectly fine if user is using icould or ios calendars

任何想法或建议?

推荐答案

最后经过几天的大量研究后,我发现像谷歌,雅虎这样的一些 EKExchange 日历不允许我们在他们的日历中添加事件。如果是这种情况,则会出现错误,错误代码为17,如下所示

Finally after a lot of research for few days , i found that Some EKExchange calendars like google , yahoo does not allow us to add events in their calendars . And if that is the case than you will get error with error code 17 as follows

"Domain=EKErrorDomain Code=17 "That account does not allow calendars to be added or removed." "

我们无能为力错误,所以我最终警告用户我们无权访问您的日历帐户。希望如果他们遇到类似的问题,这会有所帮助。

There is nothing we can do about this error, So i ended up giving alert to user that "We do not have rights to access your calendar account". Hope this helps someone if they face similar issue.

这篇关于如果用户使用非iOS帐户,则以编程方式将新日历添加到日历应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆