1

I built a HTTP request handler that outputs events in icalendar format. By default, I output events for the next 6 months, but that's completely arbitrary.

What I want to know is what date range should I use to output events for the icalendar subscription feed? On devices that support icalendar subscriptions, is a date range included in the request? That would be awesome. Otherwise, how do I know what date range is being requested by the client? Is there some sort of standard for this?

Ideally, I want to open my iphone, go to the calendar, and start navigating through the months, and see any event on the calendar, no matter how far in the future it is.

Thanks in advance.

Redtopia
  • 4,947
  • 7
  • 45
  • 68
  • I have the same issue here. The solution provided by Tim is not really a solution, as you have no control over how often the client polls the service. What was the route you took? – avanderw Jul 17 '12 at 07:32
  • I'm not sure about this... I just checked the logs and I'm not seeing any additional params added to the ical request. Because we didn't know the answer to this question, we published links that pull 365 days of events. This went out to about 500 people, and I'm seeing about 200,000 requests since last January, which tells me that the iphone is pulling the same request without adding anything to it. I haven't done extensive testing on this, but I'll if I can fit in some additional testing today and post back tomorrow. – Redtopia Jul 18 '12 at 16:05
  • I just ran a test... I subscribed to the calendar on my iphone and didn't add any date params in the query string. I looked at the logs and my specific request is in there, but there is nothing added to the query string by the iphone calendar application. So I think the way to do it is to send the entire calendar (I am returning 1 year of events) for each request. – Redtopia Jul 18 '12 at 18:38
  • That seems to be the route that I am going as well – avanderw Jul 19 '12 at 11:01

2 Answers2

1

In my testing, the iOS calendar app does not request date ranges. So my script outputs all events that occur from the time of the request through the 365 days.

Redtopia
  • 4,947
  • 7
  • 45
  • 68
0

Check what the HTTP request the phone is sending looks like. (Store it into a text file each time it gets a request.) If the phone is asking for date ranges (which I'd expect it would) there's your answer. If it's not... try just sending the whole calendar! iCalendar entries are around 250 bytes each, so you could send ten thousand events (or five events per day for the next five years) in 2.5 MB, or about 8 seconds on a typical 3G connection.

Tim
  • 14,447
  • 6
  • 40
  • 63