开发者

Readonly items in ical iphone

I need to display some events on the iphone calendar from either a local app or possibly a remote server. I need the events shown in the iphone calendar to be readonly and am trying to figure out the best approach for this. Couple of questions to help me with the approach

-From ios iphone app can I write calendar events as readonly? -If I need to go from the server to the phone can I give the phone a url to a icalendar that is readonly? which will disa开发者_StackOverflowllow updates to the item on the phone? -If I consume the events from the icalendar in to an iphone application can I tell what the origin of the item is? meaning can I tell the difference between things the user made locally, exchange, gmail etc.. and the icalendar readonly feed

Thanks


I'm afraid you cannot create a read-only calendar entry in a users calendar. After all, it's the users calendar, not your apps.

Nor can you create a separate calendar specific for your app that can read from a URL. You could provide the URL to the user and ask them to add it to iCal manually, but you cannot do it via the EventKit Framework.

You can't tell the origin of an event as EKEvent doesn't have any sort of public property that provides this information.

You would be able to infer which was the read-only calendar by iterating over the available calenders and looking at their titles. However, this would only work on the assumptions the user actually added your calendar manually, and they didn't change the title.

The best way to do something like this with all the features you want would be to add in-app calendar functionality to your app and make it completely independent of iCal and EventKit.

Here are a couple of projects which could help ...

  • Kal
  • Calendar UI
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜