title: ICS (iCal) PUBLISH/REQUEST/CANCEL
body: <p>I'm having a lot of trouble getting entries in a .ics file generated from PHP to update. Here's an example of what I'm using:</p>
  
  <pre><code>&lt;?php
  header('Content-type: text/calendar; charset=utf-8');
  header('Content-Disposition: attachment; filename=calendar.ics');
  
  $time = time();
  $dtstamp = date('Ymd', $time). 'T' . date('His', $time) . 'Z'; echo "\r\n";
  ?&gt;
  BEGIN:VCALENDAR
  VERSION:2.0
  PRODID:-//My Event
  METHOD:PUBLISH
  X-WR-CALNAME:MyCal
  BEGIN:VEVENT
  DTSTAMP:&lt;?php echo $dtstamp; ?&gt;
  ORGANIZER:someone@example.com
  SEQUENCE:0
  UID:ABC123
  DTSTART:20150601T120000
  DTEND:20150601T130000
  SUMMARY:Event 1 - &lt;?php echo date('His', $time) ."\r\n"; ?&gt;
  LOCATION:Location 1
  DESCRIPTION:This is Event 1 - &lt;?php echo date('His', $time) ."\r\n"; ?&gt;
  END:VEVENT
  BEGIN:VEVENT
  DTSTAMP:&lt;?php echo $dtstamp; ?&gt;
  ORGANIZER:someone@example.com
  SEQUENCE:0
  UID:DEF123
  DTSTART:20150601T160000
  DTEND:20150601T170000
  SUMMARY:Event 2 - &lt;?php echo date('His', $time) ."\r\n"; ?&gt;
  LOCATION:Location 2
  DESCRIPTION:This is Event 2 - &lt;?php echo date('His', $time) ."\r\n"; ?&gt;
  END:VEVENT
  END:VCALENDAR
  </code></pre>
  
  <p>So this is to output the events to a URL that can be hit in an Android or iOS device and added to the calendar. The next step would be to update the event items when needed. I've been trying to do it with something like this (initial PHP deliberately omitted):</p>
  
  <pre><code>BEGIN:VCALENDAR
  VERSION:2.0
  PRODID:-//My Event
  METHOD:PUBLISH
  X-WR-CALNAME:MyCal
  BEGIN:VEVENT
  DTSTAMP:&lt;?php echo $dtstamp; ?&gt;
  ORGANIZER:someone@example.com
  SEQUENCE:1
  UID:ABC123
  DTSTART:20150601T123000
  DTEND:20150601T130000
  SUMMARY:Event 1 - &lt;?php echo date('His', $time) ."\r\n"; ?&gt;
  LOCATION:Location 1
  DESCRIPTION:This is Event 1 - &lt;?php echo date('His', $time) ."\r\n"; ?&gt;
  END:VEVENT
  BEGIN:VEVENT
  DTSTAMP:&lt;?php echo $dtstamp; ?&gt;
  ORGANIZER:someone@example.com
  SEQUENCE:1
  UID:DEF123
  DTSTART:20150601T163000
  DTEND:20150601T170000
  SUMMARY:Event 2 - &lt;?php echo date('His', $time) ."\r\n"; ?&gt;
  LOCATION:Location 2
  DESCRIPTION:This is Event 2 - &lt;?php echo date('His', $time) ."\r\n"; ?&gt;
  END:VEVENT
  END:VCALENDAR
  </code></pre>
  
  <p>Because the DTSTAMP will always be greater than the previous entry, the sequence has been incremented and the METHOD changed to REQUEST, as far as I can tell that should be enough.</p>
  
  <p>However in Android it just adds the events again, in iOS it displays the events that already exist, with the previous details, and only gives you the option to add the events again. So, I'm wondering what it takes to get the existing events to update, and to later cancel them using METHOD:CANCEL if need be.</p>
  
  <p>Thanks.</p>