Adding a new calendar programatically to calendar

2019-02-23 12:26发布

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 "That account does not allow calendars to be added or removed." "

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

Any idea or suggestons?

1条回答
三岁会撩人
2楼-- · 2019-02-23 13:10

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.

查看更多
登录 后发表回答