Adding a new calendar programmatically to calendar app if user is using non iOS account

非 Y 不嫁゛ 提交于 2019-12-04 03:47:35

问题


Can we add a new calendar to default calendar app programmatically if user is using any other account for calendars like yahoo or hotmail, I am getting following error:

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/19721553/adding-a-new-calendar-programmatically-to-calendar-app-if-user-is-using-non-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!