<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[14126] CalendarServer/trunk/doc/Extensions</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/14126">14126</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-10-30 19:08:53 -0700 (Thu, 30 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update pubsub spec to describe the push-transports property and APNs</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkdocExtensionscaldavpubsubdiscoverytxt">CalendarServer/trunk/doc/Extensions/caldav-pubsubdiscovery.txt</a></li>
<li><a href="#CalendarServertrunkdocExtensionscaldavpubsubdiscoveryxml">CalendarServer/trunk/doc/Extensions/caldav-pubsubdiscovery.xml</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkdocExtensionscaldavpubsubdiscoverytxt"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/doc/Extensions/caldav-pubsubdiscovery.txt (14125 => 14126)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/doc/Extensions/caldav-pubsubdiscovery.txt        2014-10-30 18:29:09 UTC (rev 14125)
+++ CalendarServer/trunk/doc/Extensions/caldav-pubsubdiscovery.txt        2014-10-31 02:08:53 UTC (rev 14126)
</span><span class="lines">@@ -1,62 +1,31 @@
</span><del>-
-
-
-Calendar Server Extension                                       M. Sagen
</del><ins>+                                                                M. Sagen
</ins><span class="cx">                                                                    Apple
</span><del>-                                                            June 5, 2009
</del><ins>+                                                        October 30, 2014
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">              Discovery of CalDAV Push-Notification Settings
</span><ins>+                       caldav-pubsubdiscovery-02
</ins><span class="cx"> 
</span><span class="cx"> Abstract
</span><span class="cx"> 
</span><del>-   This specification defines three new WebDAV properties that allow
-   clients to discover push-notification subscription information,
-   eliminating the need for polling.
</del><ins>+   This specification defines new WebDAV properties that allow clients
+   to discover and subscribe to change notifications, eliminating the
+   need for polling.
</ins><span class="cx"> 
</span><del>-
</del><span class="cx"> Table of Contents
</span><span class="cx"> 
</span><del>-   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . . . 2
-   2.  Conventions Used in This Document . . . . . . . . . . . . . . . 2
-   3.  New Properties  . . . . . . . . . . . . . . . . . . . . . . . . 3
-     3.1.  XMPP Server Property  . . . . . . . . . . . . . . . . . . . 3
-     3.2.  XMPP URI Property . . . . . . . . . . . . . . . . . . . . . 3
-     3.3.  XMPP Heartbeat Property . . . . . . . . . . . . . . . . . . 4
-   4.  Normative References  . . . . . . . . . . . . . . . . . . . . . 6
-   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . . . 7
</del><ins>+   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   1
+   2.  Conventions Used in This Document . . . . . . . . . . . . . .   2
+   3.  New Properties  . . . . . . . . . . . . . . . . . . . . . . .   2
+     3.1.  Push Transports Property  . . . . . . . . . . . . . . . .   2
+     3.2.  Push Key Property . . . . . . . . . . . . . . . . . . . .   3
+   4.  Subscription Process  . . . . . . . . . . . . . . . . . . . .   4
+     4.1.  Discovery . . . . . . . . . . . . . . . . . . . . . . . .   4
+     4.2.  Subscription  . . . . . . . . . . . . . . . . . . . . . .   4
+     4.3.  Payload . . . . . . . . . . . . . . . . . . . . . . . . .   5
+   5.  Normative References  . . . . . . . . . . . . . . . . . . . .   5
+   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   5
</ins><span class="cx"> 
</span><del>-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Sagen                                                           [Page 1]
-
-                         CalDAV PubSub Discovery               June 2009
-
-
</del><span class="cx"> 1.  Introduction
</span><span class="cx"> 
</span><span class="cx">    The CalDAV [RFC4791] standard defines a way to access calendar data
</span><span class="lines">@@ -66,29 +35,28 @@
</span><span class="cx">    notifications would allow near real time propagation of updates and
</span><span class="cx">    potentially reduce the number of requests.
</span><span class="cx"> 
</span><del>-   XMPP [RFC3920], the Extensible Messaging and Presence Protocol,
-   allows close to real time exchange of structured information.  The
-   XEP-0060 specification defines an XMPP protocol extension for
-   publish-subscribe (&quot;pubsub&quot;) functionality, allowing clients to
-   subscribe to &quot;topics&quot; or &quot;nodes&quot; and receive notifications whenever
-   another client publishes to those nodes.
</del><ins>+   The Apple Push Notification Service [APPLE.APNS] (APNs for short) is
+   a service for propagating information to iOS and OS X devices in an
+   efficient manner.
</ins><span class="cx"> 
</span><del>-   A push-notification-capable CalDAV server can create and advertise a
-   pubsub node for each calendar home collection and publish to those
-   nodes whenever any resource within a calendar home is modified.  A
-   calendar client interested in receiving updates can subscribe using
-   XMPP/pubsub to one or more of these nodes.  Upon receiving a
-   notification, the client then queries the CalDAV server to determine
-   which resources have changed.
</del><ins>+   A push-notification-capable CalDAV/CardDAV server advertises the
+   capability via a DAV property (&quot;push-transports&quot;) on calendar and
+   addressbook home resources.  Each calendar and addressbook collection
+   resource has another DAV property (&quot;pushkey&quot;) which is an opaque
+   token a client can use to subscribe to change notifications for that
+   collection.  When the client receives such a notification, the client
</ins><span class="cx"> 
</span><del>-   This specification defines three new WebDAV properties on calendar
-   home collections: 1) the XMPP server the client should connect to, 2)
-   the pubsub node corresponding to the calendar home, and 3) a pubsub
-   &quot;heartbeat&quot; node which the CalDAV server publishes to at regular
-   intervals so clients know that push notifications are functioning
-   properly.
</del><span class="cx"> 
</span><span class="cx"> 
</span><ins>+
+Sagen                      Expires May 3, 2015                  [Page 1]
+
+                         CalDAV PubSub Discovery            October 2014
+
+
+   queries the CalDAV/CardDAV server to see which resources have
+   changed.
+
</ins><span class="cx"> 2.  Conventions Used in This Document
</span><span class="cx"> 
</span><span class="cx">    The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
</span><span class="lines">@@ -106,23 +74,16 @@
</span><span class="cx">    of an XML fragment, the string &quot;CS:&quot; will be prefixed to the element
</span><span class="cx">    type names respectively.
</span><span class="cx"> 
</span><del>-
-
-Sagen                                                           [Page 2]
-
-                         CalDAV PubSub Discovery               June 2009
-
-
</del><span class="cx"> 3.  New Properties
</span><span class="cx"> 
</span><del>-3.1.  XMPP Server Property
</del><ins>+3.1.  Push Transports Property
</ins><span class="cx"> 
</span><del>-   Name:  xmpp-server
</del><ins>+   Name:  push-transports
</ins><span class="cx"> 
</span><span class="cx">    Namespace:  http://calendarserver.org/ns/
</span><span class="cx"> 
</span><del>-   Purpose:  Provides the hostname of the XMPP server a client should
-      connect to for subscribing to notifications.
</del><ins>+   Purpose:  Advertises the list of push transports supported by the
+      server.
</ins><span class="cx"> 
</span><span class="cx">    Protected:  This property MUST be protected and SHOULD NOT be
</span><span class="cx">       returned by a PROPFIND allprop request (as defined in Section 14.2
</span><span class="lines">@@ -132,168 +93,168 @@
</span><span class="cx">       operation, but is normally re-initialized when a resource is
</span><span class="cx">       created with a COPY.  It should not be set in a COPY.
</span><span class="cx"> 
</span><del>-   Description:  This property MUST be defined on a calendar home
-      collection.  Its value is the hostname of the XMPP server the
-      CalDAV server is using to publish change notifications to.
-      Clients wanting to receive notifications must make an XMPP
-      connection to the host specified in this property.
</del><ins>+   Description:  This property MUST be defined on a calendar or
+      addressbook home collection and MUST NOT be defined on a calendar
+      or addressbook collection.  Its value is an XML element whose
+      child elements each represent a supported push transport protocol.
</ins><span class="cx"> 
</span><span class="cx">    Definition:
</span><span class="cx"> 
</span><del>-   &lt;!ELEMENT xmpp-server (#PCDATA) &gt;
</del><span class="cx"> 
</span><del>-   Example:  This example indicates that the CalDAV server is using host
-      notifications.example.com for sending push notifications.
</del><span class="cx"> 
</span><del>-   &lt;CS:xmpp-server
-        xmlns:CS=&quot;http://calendarserver.org/ns/&quot;&gt;
-        notifications.example.com
-   &lt;/CS:xmpp-server&gt;
</del><span class="cx"> 
</span><del>-3.2.  XMPP URI Property
</del><span class="cx"> 
</span><del>-   Name:  xmpp-uri
</del><span class="cx"> 
</span><del>-   Namespace:  http://calendarserver.org/ns/
</del><ins>+Sagen                      Expires May 3, 2015                  [Page 2]
+
+                         CalDAV PubSub Discovery            October 2014
</ins><span class="cx"> 
</span><del>-   Purpose:  Provides the URI of the pubsub node to subscribe to in
-      order to receive a notification whenever a resource within this
-      calendar home has changed.
</del><span class="cx"> 
</span><ins>+&lt;!ELEMENT push-transports (transport) &gt;
</ins><span class="cx"> 
</span><ins>+&lt;!ELEMENT transport (subscription-url, apsbundleid, env, refresh-interval) &gt;
+&lt;!-- The transport element must have a 'type' attribute identifying the transport type.  For Apple Push the attribute value should be 'APSD'. --&gt;
</ins><span class="cx"> 
</span><ins>+&lt;!ELEMENT subscription-url (DAV:href) &gt;
+&lt;!-- The URL clients should send their subscription requests to.  --&gt;
</ins><span class="cx"> 
</span><ins>+&lt;!ELEMENT apsbundleid (CDATA) &gt;
+&lt;!-- The Apple Push &quot;topic&quot;, which is extracted from the UID portion of the subject of the certificate acquired from Apple.  The topic is currently the bundle identifier of the target app. --&gt;
</ins><span class="cx"> 
</span><del>-Sagen                                                           [Page 3]
-
-                         CalDAV PubSub Discovery               June 2009
</del><ins>+&lt;!ELEMENT env (CDATA) &gt;
+&lt;!-- &quot;PRODUCTION&quot; if the clients should talk to the production APNs servers or &quot;SANDBOX&quot; if the clients should talk to the sandbox APNs servers --&gt;
</ins><span class="cx"> 
</span><ins>+&lt;!ELEMENT refresh-interval (CDATA) &gt;
+&lt;!-- An integer value indicating how often (in seconds) the client should refresh their subscriptions, since the server will remove subscriptions that are not refreshed within this time period --&gt;
</ins><span class="cx"> 
</span><del>-   Protected:  This property MUST be protected and SHOULD NOT be
-      returned by a PROPFIND allprop request (as defined in Section 14.2
-      of [RFC4918]).
</del><span class="cx"> 
</span><del>-   COPY/MOVE behavior:  This property value SHOULD be kept during a MOVE
-      operation, but is normally re-initialized when a resource is
-      created with a COPY.  It should not be set in a COPY.
</del><ins>+   Example:  This example indicates the CalDAV/CardDAV server is using
+      the production APNs service and clients should send their
+      subscription requests to https://server.example.com:8443/apns at
+      least every 172800 seconds (2 days).
</ins><span class="cx"> 
</span><del>-   Description:  This property MUST be defined on a calendar home
-      collection.  Its value is the XMPP URI [RFC4622] of the pubsub
-      node the CalDAV server will publish to whenever any change is made
-      within the calendar home collection.  Clients wanting to receive
-      notifications for this calendar home must subscribe to this node.
</del><ins>+&lt;push-transports xmlns='http://calendarserver.org/ns/'&gt;
+  &lt;transport type='APSD'&gt;
+    &lt;subscription-url&gt;
+      &lt;href xmlns='DAV:'&gt;https://server.example.com:8443/apns&lt;/href&gt;
+    &lt;/subscription-url&gt;
+    &lt;apsbundleid&gt;com.apple.calendar.XServer.934668ca-125e-4246-afee-8cf2df37aab8&lt;/apsbundleid&gt;
+    &lt;env&gt;PRODUCTION&lt;/env&gt;
+    &lt;refresh-interval&gt;172800&lt;/refresh-interval&gt;
+  &lt;/transport&gt;
+&lt;/push-transports&gt;
</ins><span class="cx"> 
</span><del>-   Definition:
</del><ins>+3.2.  Push Key Property
</ins><span class="cx"> 
</span><del>-   &lt;!ELEMENT xmpp-uri (#PCDATA) &gt;
</del><ins>+   Name:  pushkey
</ins><span class="cx"> 
</span><del>-   Example:  This example describes an XMPP URI which is comprised of
-      the CalDAV server's hostname and port, so that multiple CalDAV
-      servers can share the same notification server.
-
-   &lt;CS:xmpp-uri
-        xmlns:CS=&quot;http://calendarserver.org/ns/&quot;&gt;
-        xmpp:pubsub.notifications.example.com?pubsub;
-         node=/Public/CalDAV/notifications.example.com/443/
-         calendars/users/sagen/
-   &lt;/CS:xmpp-uri&gt;
-
-3.3.  XMPP Heartbeat Property
-
-   Name:  xmpp-heartbeat
-
</del><span class="cx">    Namespace:  http://calendarserver.org/ns/
</span><span class="cx"> 
</span><del>-   Purpose:  Provides the URI of the heartbeat pubsub node and the
-      frequency at which it is published.
</del><ins>+   Purpose:  Provides the push key to subscribe to in order to receive a
+      notification whenever a resource within this collection has
+      changed.
</ins><span class="cx"> 
</span><span class="cx">    Protected:  This property MUST be protected and SHOULD NOT be
</span><span class="cx">       returned by a PROPFIND allprop request (as defined in Section 14.2
</span><span class="cx">       of [RFC4918]).
</span><span class="cx"> 
</span><del>-   COPY/MOVE behavior:  This property value SHOULD be kept during a MOVE
-      operation, but is normally re-initialized when a resource is
-      created with a COPY.  It should not be set in a COPY.
</del><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-
-
-
-Sagen                                                           [Page 4]
</del><ins>+Sagen                      Expires May 3, 2015                  [Page 3]
</ins><span class="cx"> 
</span><del>-                         CalDAV PubSub Discovery               June 2009
</del><ins>+                         CalDAV PubSub Discovery            October 2014
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-   Description:  This property MAY be defined on a calendar home
-      collection.  If it's not defined, then the server does not support
-      heartbeats for this calendar home.  Its value is comprised of two
-      elements: the XMPP URI [RFC4622] of the heartbeat pubsub node the
-      CalDAV server will publish to periodically, and the frequency (in
-      minutes) at which this heartbeat is published.  Clients may
-      monitor updates to this heartbeat node to determine whether the
-      push notification system is functioning.  If no update is received
-      for this node for a period exceeding xmpp-heartbeat-minutes, the
-      client can assume that notifications are not working and may fall
-      back to polling.
</del><ins>+   COPY/MOVE behavior:  This property value SHOULD be kept during a MOVE
+      operation, but is normally re-initialized when a resource is
+      created with a COPY.  It should not be set in a COPY.
</ins><span class="cx"> 
</span><ins>+   Description:  This property MUST be defined on calendar and
+      addressbook home collections as well as calendar and addressbook
+      collections.  Its value is a server-generated string associated
+      with a collection.  The client must send a subscription request
+      containing the &quot;push key&quot; string to subscribe to change
+      notifications for the collection.  The push key for a calendar or
+      addressbook collection will normally be the same value as the
+      containing home collection.  However, there are circumstances
+      (such as shared collections) where the push keys for collections
+      are not the same as the containing home, and thus clients should
+      subscribe to the push keys for the home collection and each
+      contained collection.
+
</ins><span class="cx">    Definition:
</span><span class="cx"> 
</span><del>-   &lt;!ELEMENT xmpp-hearbeat CS:xmpp-heartbeat-uri,
-                           CS:xmpp-heartbeat-minutes&gt;
</del><ins>+   &lt;!ELEMENT pushkey (CDATA) &gt;
</ins><span class="cx"> 
</span><del>-   &lt;!ELEMENT xmpp-hearbeat-uri (#PCDATA) &gt;
</del><ins>+   Example:  This example indicates the push key for a collection is the
+      UUID '6D6241DC-5981-4D87-9B71-672203E81ACB'.
</ins><span class="cx"> 
</span><del>-   &lt;!ELEMENT xmpp-hearbeat-minutes (#PCDATA) &gt;
</del><ins>+&lt;pushkey xmlns='http://calendarserver.org/ns/'&gt;6D6241DC-5981-4D87-9B71-672203E81ACB/&lt;/pushkey&gt;
</ins><span class="cx"> 
</span><ins>+4.  Subscription Process
</ins><span class="cx"> 
</span><del>-   Example:
</del><ins>+4.1.  Discovery
</ins><span class="cx"> 
</span><del>-   &lt;CS:xmpp-heartbeat&gt;
-     &lt;CS:xmpp-heartbeat-uri&gt;
-        xmlns:CS=&quot;http://calendarserver.org/ns/&quot;&gt;
-        xmpp:pubsub.notifications.example.com?pubsub;
-         node=/Public/CalDAV/notifications.example.com/443/
-     &lt;/CS:xmpp-heartbeat-uri&gt;
-     &lt;CS:xmpp-heartbeat-minutes&gt;30&lt;/CS:xmpp-heartbeat-minutes&gt;
-   &lt;/CS:xmpp-heartbeat&gt;
</del><ins>+   To subscribe to change notifications, the client must first fetch the
+   &quot;push-transports&quot; property for the principal's calendar or
+   addressbook home.  The &quot;transport&quot; child element with type set to
+   &quot;APSD&quot; identifies the APNs configuration.  The &quot;subscription-url&quot;
+   element identifies the URL clients will need to send subscription
+   requests to.  Next, for each home and collection the client is
+   interested in receiving change notifications for, the client should
+   fetch the &quot;pushkey&quot; property.  Some collections' push keys will be
+   the same as their parent collection, but not always.  Each unique
+   push key the client finds should be subscribed to at least every
+   &quot;refresh-interval&quot; seconds.
</ins><span class="cx"> 
</span><ins>+4.2.  Subscription
</ins><span class="cx"> 
</span><ins>+   As per the APNs documentation, the client must acquire a &quot;device
+   token&quot; identifying the device to the APNs servers.  Next, for each
+   unique push key the client wants to subscribe to, the client must
+   send an authenticated HTTP request including the device token and
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+Sagen                      Expires May 3, 2015                  [Page 4]
+
+                         CalDAV PubSub Discovery            October 2014
</ins><span class="cx"> 
</span><span class="cx"> 
</span><ins>+   push key values to the URL identified by subscription-url.  The field
+   names to use are &quot;token&quot; and &quot;key&quot;, respectively.  If the client uses
+   GET, the token and key can be passed as query string parameters; if
+   using POST they can be sent as form fields.  The server will return
+   an HTTP status code OK (200) if the subscription was successful, or
+   BAD_REQUEST (400) with an explanation message in the response body
+   otherwise.
</ins><span class="cx"> 
</span><ins>+4.3.  Payload
</ins><span class="cx"> 
</span><ins>+   The payload of each push notification will contain:
</ins><span class="cx"> 
</span><ins>+      &quot;key&quot; - the push key of the collection
</ins><span class="cx"> 
</span><ins>+      &quot;dataChangedTimestamp&quot; - the unix epoch time (in seconds) when the
+      change that triggered this notification took place
</ins><span class="cx"> 
</span><ins>+      &quot;pushRequestSubmittedTimestamp&quot; - the unix epoch time (in seconds)
+      when the CalDAV/CardDAV server sent the notification to the APNs
+      servers
</ins><span class="cx"> 
</span><ins>+5.  Normative References
</ins><span class="cx"> 
</span><ins>+   [APPLE.APNS]
+              Apple Inc., &quot;Apple Push Notification Service&quot;, Apple Inc
+              iOS Developer Library, October 2014, &lt; https://developer.a
+              pple.com/library/ios/documentation/NetworkingInternet/Conc
+              eptual/RemoteNotificationsPG/Chapters/
+              ApplePushService.html&gt;.
</ins><span class="cx"> 
</span><del>-
-
-
-
-Sagen                                                           [Page 5]
-
-                         CalDAV PubSub Discovery               June 2009
-
-
-4.  Normative References
-
</del><span class="cx">    [RFC2119]  Bradner, S., &quot;Key words for use in RFCs to Indicate
</span><span class="cx">               Requirement Levels&quot;, BCP 14, RFC 2119, March 1997.
</span><span class="cx"> 
</span><del>-   [RFC3920]  Saint-Andre, P., Ed., &quot;Extensible Messaging and Presence
-              Protocol (XMPP): Core&quot;, RFC 3920, October 2004.
-
-   [RFC4622]  Saint-Andre, P., &quot;Internationalized Resource Identifiers
-              (IRIs) and Uniform Resource Identifiers (URIs) for the
-              Extensible Messaging and Presence Protocol (XMPP)&quot;,
-              RFC 4622, July 2006.
-
</del><span class="cx">    [RFC4791]  Daboo, C., Desruisseaux, B., and L. Dusseault,
</span><span class="cx">               &quot;Calendaring Extensions to WebDAV (CalDAV)&quot;, RFC 4791,
</span><span class="cx">               March 2007.
</span><span class="lines">@@ -301,6 +262,7 @@
</span><span class="cx">    [RFC4918]  Dusseault, L., &quot;HTTP Extensions for Web Distributed
</span><span class="cx">               Authoring and Versioning (WebDAV)&quot;, RFC 4918, June 2007.
</span><span class="cx"> 
</span><ins>+Author's Address
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -311,34 +273,11 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Sagen                                                           [Page 6]
</del><ins>+Sagen                      Expires May 3, 2015                  [Page 5]
</ins><span class="cx"> 
</span><del>-                         CalDAV PubSub Discovery               June 2009
</del><ins>+                         CalDAV PubSub Discovery            October 2014
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-Author's Address
-
</del><span class="cx">    Morgen Sagen
</span><span class="cx">    Apple Inc.
</span><span class="cx">    1 Infinite Loop
</span><span class="lines">@@ -388,5 +327,6 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-Sagen                                                           [Page 7]
-
</del><ins>+
+
+Sagen                      Expires May 3, 2015                  [Page 6]
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="CalendarServertrunkdocExtensionscaldavpubsubdiscoveryxml"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/doc/Extensions/caldav-pubsubdiscovery.xml (14125 => 14126)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/doc/Extensions/caldav-pubsubdiscovery.xml        2014-10-30 18:29:09 UTC (rev 14125)
+++ CalendarServer/trunk/doc/Extensions/caldav-pubsubdiscovery.xml        2014-10-31 02:08:53 UTC (rev 14126)
</span><span class="lines">@@ -1,11 +1,9 @@
</span><span class="cx"> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
</span><span class="cx"> &lt;!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [
</span><span class="cx"> &lt;!ENTITY rfc2119 PUBLIC '' 'bibxml/reference.RFC.2119.xml'&gt;
</span><del>-&lt;!ENTITY rfc3920 PUBLIC '' 'bibxml/reference.RFC.3920.xml'&gt;
-&lt;!ENTITY rfc4622 PUBLIC '' 'bibxml/reference.RFC.4622.xml'&gt;
</del><span class="cx"> &lt;!ENTITY rfc4791 PUBLIC '' 'bibxml/reference.RFC.4791.xml'&gt;
</span><span class="cx"> &lt;!ENTITY rfc4918 PUBLIC '' 'bibxml/reference.RFC.4918.xml'&gt;
</span><del>-]&gt; 
</del><ins>+]&gt;
</ins><span class="cx"> &lt;?rfc toc=&quot;yes&quot;?&gt;
</span><span class="cx"> &lt;?rfc tocdepth=&quot;4&quot;?&gt;
</span><span class="cx"> &lt;?rfc strict=&quot;yes&quot;?&gt;
</span><span class="lines">@@ -16,7 +14,7 @@
</span><span class="cx"> &lt;?rfc compact=&quot;yes&quot;?&gt;
</span><span class="cx"> &lt;?rfc subcompact=&quot;no&quot;?&gt;
</span><span class="cx"> &lt;?rfc private=&quot;Calendar Server Extension&quot;?&gt;
</span><del>-&lt;rfc ipr=&quot;none&quot; docName='caldav-pubsubdiscovery-01'&gt;
</del><ins>+&lt;rfc ipr=&quot;none&quot; docName='caldav-pubsubdiscovery-02'&gt;
</ins><span class="cx">     &lt;front&gt;
</span><span class="cx">         &lt;title abbrev=&quot;CalDAV PubSub Discovery&quot;&gt;Discovery of CalDAV Push-Notification Settings&lt;/title&gt;
</span><span class="cx">         &lt;author initials=&quot;M.&quot; surname=&quot;Sagen&quot; fullname=&quot;Morgen Sagen&quot;&gt;
</span><span class="lines">@@ -28,7 +26,7 @@
</span><span class="cx">                     &lt;street&gt;1 Infinite Loop&lt;/street&gt;
</span><span class="cx">                     &lt;city&gt;Cupertino&lt;/city&gt;
</span><span class="cx">                     &lt;region&gt;CA&lt;/region&gt;
</span><del>-                    &lt;code&gt;95014&lt;/code&gt; 
</del><ins>+                    &lt;code&gt;95014&lt;/code&gt;
</ins><span class="cx">                     &lt;country&gt;USA&lt;/country&gt;
</span><span class="cx">                 &lt;/postal&gt;
</span><span class="cx">                 &lt;email&gt;sagen@apple.com&lt;/email&gt;
</span><span class="lines">@@ -38,7 +36,7 @@
</span><span class="cx">         &lt;date/&gt;
</span><span class="cx">         &lt;abstract&gt;
</span><span class="cx">             &lt;t&gt;
</span><del>-                This specification defines three new WebDAV properties that allow clients to discover push-notification subscription information, eliminating the need for polling.
</del><ins>+                This specification defines new WebDAV properties that allow clients to discover and subscribe to change notifications, eliminating the need for polling.
</ins><span class="cx">             &lt;/t&gt;
</span><span class="cx">         &lt;/abstract&gt;
</span><span class="cx">     &lt;/front&gt;
</span><span class="lines">@@ -48,87 +46,103 @@
</span><span class="cx">             The &lt;xref target=&quot;RFC4791&quot;&gt;CalDAV&lt;/xref&gt; standard defines a way to access calendar data stored on a server.  Clients typically poll the server for changes, which leads to unnecessary traffic and delays in propagating calendar updates.  Having clients instead subscribe to calendar change notifications would allow near real time propagation of updates and potentially reduce the number of requests.
</span><span class="cx">             &lt;/t&gt;
</span><span class="cx">             &lt;t&gt;
</span><del>-                        &lt;xref target=&quot;RFC3920&quot;&gt;XMPP&lt;/xref&gt;, the Extensible Messaging and Presence Protocol, allows close to real time exchange of structured information.  The XEP-0060 specification defines an XMPP protocol extension for publish-subscribe (&quot;pubsub&quot;) functionality, allowing clients to subscribe to &quot;topics&quot; or &quot;nodes&quot; and receive notifications whenever another client publishes to those nodes.
</del><ins>+            The &lt;xref target=&quot;APPLE.APNS&quot;&gt;Apple Push Notification Service&lt;/xref&gt; (APNs for short)
+                        is a service for propagating information to iOS and OS X devices in
+            an efficient manner.
</ins><span class="cx">                         &lt;/t&gt;
</span><span class="cx">                         &lt;t&gt;
</span><del>-                        A push-notification-capable CalDAV server can create and advertise a pubsub node for each calendar home collection and publish to those nodes whenever any resource within a calendar home is modified.  A calendar client interested in receiving updates can subscribe using XMPP/pubsub to one or more of these nodes.  Upon receiving a notification, the client then queries the CalDAV server to determine which resources have changed.
</del><ins>+                        A push-notification-capable CalDAV/CardDAV server advertises the capability via a DAV property (&quot;push-transports&quot;) on calendar and addressbook home resources.  Each calendar and addressbook collection resource has another DAV property (&quot;pushkey&quot;) which is an opaque token a client can use to subscribe to change notifications for that collection.  When the client receives such a notification, the client queries the CalDAV/CardDAV server to see which resources have changed.
</ins><span class="cx">             &lt;/t&gt;
</span><del>-            &lt;t&gt;
-            This specification defines three new WebDAV properties on calendar home collections:  1) the XMPP server the client should connect to, 2) the pubsub node corresponding to the calendar home, and 3) a pubsub &quot;heartbeat&quot; node which the CalDAV server publishes to at regular intervals so clients know that push notifications are functioning properly.
-            &lt;/t&gt;
</del><span class="cx">         &lt;/section&gt;
</span><span class="cx">         &lt;section title='Conventions Used in This Document'&gt;
</span><span class="cx">             &lt;t&gt;
</span><del>-                The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as described in &lt;xref target='RFC2119' /&gt;. 
</del><ins>+                The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as described in &lt;xref target='RFC2119' /&gt;.
</ins><span class="cx">             &lt;/t&gt;
</span><span class="cx">             &lt;t&gt;
</span><del>-                When XML element types in the namespaces &quot;DAV:&quot; and &quot;urn:ietf:params:xml:ns:caldav&quot; are referenced in this document outside of the context of an XML fragment, the string &quot;DAV:&quot; and &quot;CALDAV:&quot; will be prefixed to the element type names respectively. 
</del><ins>+                When XML element types in the namespaces &quot;DAV:&quot; and &quot;urn:ietf:params:xml:ns:caldav&quot; are referenced in this document outside of the context of an XML fragment, the string &quot;DAV:&quot; and &quot;CALDAV:&quot; will be prefixed to the element type names respectively.
</ins><span class="cx">             &lt;/t&gt;
</span><span class="cx">             &lt;t&gt;
</span><del>-                The namespace &quot;http://calendarserver.org/ns/&quot; is used for XML elements defined in this specification.  When XML element types in this namespace are referenced in this document outside of the context of an XML fragment, the string &quot;CS:&quot; will be prefixed to the element type names respectively. 
</del><ins>+                The namespace &quot;http://calendarserver.org/ns/&quot; is used for XML elements defined in this specification.  When XML element types in this namespace are referenced in this document outside of the context of an XML fragment, the string &quot;CS:&quot; will be prefixed to the element type names respectively.
</ins><span class="cx">             &lt;/t&gt;
</span><span class="cx">         &lt;/section&gt;
</span><del>-        
</del><ins>+
</ins><span class="cx">         &lt;section title='New Properties'&gt;
</span><del>-            &lt;section title=&quot;XMPP Server Property&quot;&gt;
</del><ins>+            &lt;section title=&quot;Push Transports Property&quot;&gt;
</ins><span class="cx">                 &lt;t&gt;
</span><span class="cx"> &lt;?rfc compact=&quot;no&quot; ?&gt;
</span><span class="cx">                     &lt;list style=&quot;hanging&quot;&gt;
</span><del>-                        &lt;t hangText=&quot;Name:&quot;&gt;xmpp-server&lt;/t&gt;
</del><ins>+                        &lt;t hangText=&quot;Name:&quot;&gt;push-transports&lt;/t&gt;
</ins><span class="cx">                         &lt;t hangText=&quot;Namespace:&quot;&gt;http://calendarserver.org/ns/&lt;/t&gt;
</span><del>-                        &lt;t hangText=&quot;Purpose:&quot;&gt;Provides the hostname of the XMPP server a client should connect to for subscribing to notifications.&lt;/t&gt;
</del><ins>+                        &lt;t hangText=&quot;Purpose:&quot;&gt;Advertises the list of push transports supported by the server.&lt;/t&gt;
</ins><span class="cx">                         &lt;t hangText=&quot;Protected:&quot;&gt;This property MUST be protected and SHOULD NOT be returned by a PROPFIND allprop request (as defined in Section 14.2 of &lt;xref target=&quot;RFC4918&quot;/&gt;).&lt;/t&gt;
</span><span class="cx">                         &lt;t hangText=&quot;COPY/MOVE behavior:&quot;&gt;This property value SHOULD be kept during a MOVE operation, but is normally re-initialized when a resource is created with a COPY. It should not be set in a COPY.&lt;/t&gt;
</span><del>-                        &lt;t hangText=&quot;Description:&quot;&gt;This property MUST be defined on a calendar home collection.  Its value is the hostname of the XMPP server the CalDAV server is using to publish change notifications to.  Clients wanting to receive notifications must make an XMPP connection to the host specified in this property.&lt;/t&gt;
</del><ins>+                        &lt;t hangText=&quot;Description:&quot;&gt;This property MUST be defined on a calendar or addressbook home collection and MUST NOT be defined on a calendar or addressbook collection.  Its value is an XML element whose child elements each represent a supported push transport protocol.&lt;/t&gt;
</ins><span class="cx">                         &lt;t hangText=&quot;Definition:&quot;&gt;
</span><span class="cx">                             &lt;figure&gt;
</span><span class="cx">                                 &lt;artwork&gt;&lt;![CDATA[
</span><del>-&lt;!ELEMENT xmpp-server (#PCDATA) &gt;
</del><ins>+&lt;!ELEMENT push-transports (transport) &gt;
+
+&lt;!ELEMENT transport (subscription-url, apsbundleid, env, refresh-interval) &gt;
+&lt;!-- The transport element must have a 'type' attribute identifying the transport type.  For Apple Push the attribute value should be 'APSD'. --&gt;
+
+&lt;!ELEMENT subscription-url (DAV:href) &gt;
+&lt;!-- The URL clients should send their subscription requests to.  --&gt;
+
+&lt;!ELEMENT apsbundleid (CDATA) &gt;
+&lt;!-- The Apple Push &quot;topic&quot;, which is extracted from the UID portion of the subject of the certificate acquired from Apple.  The topic is currently the bundle identifier of the target app. --&gt;
+
+&lt;!ELEMENT env (CDATA) &gt;
+&lt;!-- &quot;PRODUCTION&quot; if the clients should talk to the production APNs servers or &quot;SANDBOX&quot; if the clients should talk to the sandbox APNs servers --&gt;
+
+&lt;!ELEMENT refresh-interval (CDATA) &gt;
+&lt;!-- An integer value indicating how often (in seconds) the client should refresh their subscriptions, since the server will remove subscriptions that are not refreshed within this time period --&gt;
+
</ins><span class="cx"> ]]&gt;&lt;/artwork&gt;
</span><ins>+
</ins><span class="cx">                             &lt;/figure&gt;
</span><span class="cx">                         &lt;/t&gt;
</span><span class="cx">                         &lt;t hangText=&quot;Example:&quot;&gt;
</span><del>-                           This example indicates that the CalDAV server is using host notifications.example.com for sending push notifications.
</del><ins>+                           This example indicates the CalDAV/CardDAV server is using the production APNs service and clients should send their subscription requests to https://server.example.com:8443/apns at least every 172800 seconds (2 days).
</ins><span class="cx">                             &lt;figure&gt;
</span><span class="cx">                                 &lt;artwork&gt;&lt;![CDATA[
</span><del>-&lt;CS:xmpp-server
-     xmlns:CS=&quot;http://calendarserver.org/ns/&quot;&gt;
-     notifications.example.com
-&lt;/CS:xmpp-server&gt;
-                   ]]&gt;&lt;/artwork&gt;
</del><ins>+&lt;push-transports xmlns='http://calendarserver.org/ns/'&gt;
+  &lt;transport type='APSD'&gt;
+    &lt;subscription-url&gt;
+      &lt;href xmlns='DAV:'&gt;https://server.example.com:8443/apns&lt;/href&gt;
+    &lt;/subscription-url&gt;
+    &lt;apsbundleid&gt;com.apple.calendar.XServer.934668ca-125e-4246-afee-8cf2df37aab8&lt;/apsbundleid&gt;
+    &lt;env&gt;PRODUCTION&lt;/env&gt;
+    &lt;refresh-interval&gt;172800&lt;/refresh-interval&gt;
+  &lt;/transport&gt;
+&lt;/push-transports&gt;  ]]&gt;&lt;/artwork&gt;
</ins><span class="cx">                             &lt;/figure&gt;
</span><span class="cx">                         &lt;/t&gt;
</span><span class="cx">                                         &lt;/list&gt;
</span><span class="cx">                                 &lt;/t&gt;
</span><span class="cx">                         &lt;/section&gt;
</span><span class="cx"> 
</span><del>-            &lt;section title=&quot;XMPP URI Property&quot;&gt;
</del><ins>+            &lt;section title=&quot;Push Key Property&quot;&gt;
</ins><span class="cx">                 &lt;t&gt;
</span><span class="cx"> &lt;?rfc compact=&quot;no&quot; ?&gt;
</span><span class="cx">                     &lt;list style=&quot;hanging&quot;&gt;
</span><del>-                        &lt;t hangText=&quot;Name:&quot;&gt;xmpp-uri&lt;/t&gt;
</del><ins>+                        &lt;t hangText=&quot;Name:&quot;&gt;pushkey&lt;/t&gt;
</ins><span class="cx">                         &lt;t hangText=&quot;Namespace:&quot;&gt;http://calendarserver.org/ns/&lt;/t&gt;
</span><del>-                        &lt;t hangText=&quot;Purpose:&quot;&gt;Provides the URI of the pubsub node to subscribe to in order to receive a notification whenever a resource within this calendar home has changed.&lt;/t&gt;
</del><ins>+                        &lt;t hangText=&quot;Purpose:&quot;&gt;Provides the push key to subscribe to in order to receive a notification whenever a resource within this collection has changed.&lt;/t&gt;
</ins><span class="cx">                         &lt;t hangText=&quot;Protected:&quot;&gt;This property MUST be protected and SHOULD NOT be returned by a PROPFIND allprop request (as defined in Section 14.2 of &lt;xref target=&quot;RFC4918&quot;/&gt;).&lt;/t&gt;
</span><span class="cx">                         &lt;t hangText=&quot;COPY/MOVE behavior:&quot;&gt;This property value SHOULD be kept during a MOVE operation, but is normally re-initialized when a resource is created with a COPY. It should not be set in a COPY.&lt;/t&gt;
</span><del>-                        &lt;t hangText=&quot;Description:&quot;&gt;This property MUST be defined on a calendar home collection.  Its value is the &lt;xref target=&quot;RFC4622&quot;&gt;XMPP URI&lt;/xref&gt; of the pubsub node the CalDAV server will publish to whenever any change is made within the calendar home collection.  Clients wanting to receive notifications for this calendar home must subscribe to this node.&lt;/t&gt;
</del><ins>+                        &lt;t hangText=&quot;Description:&quot;&gt;This property MUST be defined on calendar and addressbook home collections as well as calendar and addressbook collections.  Its value is a server-generated string associated with a collection.  The client must send a subscription request containing the &quot;push key&quot; string to subscribe to change notifications for the collection.  The push key for a calendar or addressbook collection will normally be the same value as the containing home collection.  However, there are circumstances (such as shared collections) where the push keys for collections are not the same as the containing home, and thus clients should subscribe to the push keys for the home collection and each contained collection.&lt;/t&gt;
</ins><span class="cx">                         &lt;t hangText=&quot;Definition:&quot;&gt;
</span><span class="cx">                             &lt;figure&gt;
</span><span class="cx">                                 &lt;artwork&gt;&lt;![CDATA[
</span><del>-&lt;!ELEMENT xmpp-uri (#PCDATA) &gt;
</del><ins>+&lt;!ELEMENT pushkey (CDATA) &gt;
</ins><span class="cx"> ]]&gt;&lt;/artwork&gt;
</span><span class="cx">                             &lt;/figure&gt;
</span><span class="cx">                         &lt;/t&gt;
</span><span class="cx">                         &lt;t hangText=&quot;Example:&quot;&gt;
</span><del>-                                                        This example describes an XMPP URI which is comprised of the CalDAV server's hostname and port, so that multiple CalDAV servers can share the same notification server.
</del><ins>+                                                        This example indicates the push key for a collection is the UUID '6D6241DC-5981-4D87-9B71-672203E81ACB'.
</ins><span class="cx">                             &lt;figure&gt;
</span><span class="cx">                                 &lt;artwork&gt;&lt;![CDATA[
</span><del>-&lt;CS:xmpp-uri
-     xmlns:CS=&quot;http://calendarserver.org/ns/&quot;&gt;
-     xmpp:pubsub.notifications.example.com?pubsub;
-      node=/Public/CalDAV/notifications.example.com/443/
-      calendars/users/sagen/
-&lt;/CS:xmpp-uri&gt;
</del><ins>+&lt;pushkey xmlns='http://calendarserver.org/ns/'&gt;6D6241DC-5981-4D87-9B71-672203E81ACB/&lt;/pushkey&gt;
</ins><span class="cx">                    ]]&gt;&lt;/artwork&gt;
</span><span class="cx">                             &lt;/figure&gt;
</span><span class="cx">                         &lt;/t&gt;
</span><span class="lines">@@ -136,56 +150,49 @@
</span><span class="cx">                                 &lt;/t&gt;
</span><span class="cx">                         &lt;/section&gt;
</span><span class="cx"> 
</span><del>-            &lt;section title=&quot;XMPP Heartbeat Property&quot;&gt;
</del><ins>+        &lt;/section&gt;
+        &lt;section title='Subscription Process'&gt;
+            &lt;section title=&quot;Discovery&quot;&gt;
</ins><span class="cx">                 &lt;t&gt;
</span><del>-&lt;?rfc compact=&quot;no&quot; ?&gt;
</del><ins>+                    To subscribe to change notifications, the client must first fetch the &quot;push-transports&quot; property for the principal's calendar or addressbook home.  The &quot;transport&quot; child element with type set to &quot;APSD&quot; identifies the APNs configuration.  The &quot;subscription-url&quot; element identifies the URL clients will need to send subscription requests to.  Next, for each home and collection the client is interested in receiving change notifications for, the client should fetch the &quot;pushkey&quot; property.  Some collections' push keys will be the same as their parent collection, but not always.  Each unique push key the client finds should be subscribed to at least every &quot;refresh-interval&quot; seconds.
+                &lt;/t&gt;
+            &lt;/section&gt;
+            &lt;section title=&quot;Subscription&quot;&gt;
+                &lt;t&gt;
+                    As per the APNs documentation, the client must acquire a &quot;device token&quot; identifying the device to the APNs servers.  Next, for each unique push key the client wants to subscribe to, the client must send an authenticated HTTP request including the device token and push key values to the URL identified by subscription-url.  The field names to use are &quot;token&quot; and &quot;key&quot;, respectively.  If the client uses GET, the token and key can be passed as query string parameters; if using POST they can be sent as form fields.  The server will return an HTTP status code OK (200) if the subscription was successful, or BAD_REQUEST (400) with an explanation message in the response body otherwise.
+                &lt;/t&gt;
+            &lt;/section&gt;
+            &lt;section title=&quot;Payload&quot;&gt;
+                &lt;t&gt;
+                    The payload of each push notification will contain:
</ins><span class="cx">                     &lt;list style=&quot;hanging&quot;&gt;
</span><del>-                        &lt;t hangText=&quot;Name:&quot;&gt;xmpp-heartbeat&lt;/t&gt;
-                        &lt;t hangText=&quot;Namespace:&quot;&gt;http://calendarserver.org/ns/&lt;/t&gt;
-                        &lt;t hangText=&quot;Purpose:&quot;&gt;Provides the URI of the heartbeat pubsub node and the frequency at which it is published.&lt;/t&gt;
-                        &lt;t hangText=&quot;Protected:&quot;&gt;This property MUST be protected and SHOULD NOT be returned by a PROPFIND allprop request (as defined in Section 14.2 of &lt;xref target=&quot;RFC4918&quot;/&gt;).&lt;/t&gt;
-                        &lt;t hangText=&quot;COPY/MOVE behavior:&quot;&gt;This property value SHOULD be kept during a MOVE operation, but is normally re-initialized when a resource is created with a COPY. It should not be set in a COPY.&lt;/t&gt;
-                        &lt;t hangText=&quot;Description:&quot;&gt;This property MAY be defined on a calendar home collection.  If it's not defined, then the server does not support heartbeats for this calendar home.  Its value is comprised of two elements: the &lt;xref target=&quot;RFC4622&quot;&gt;XMPP URI&lt;/xref&gt; of the heartbeat pubsub node the CalDAV server will publish to periodically, and the frequency (in minutes) at which this heartbeat is published.  Clients may monitor updates to this heartbeat node to determine whether the push notification system is functioning.  If no update is received for this node for a period exceeding xmpp-heartbeat-minutes, the client can assume that notifications are not working and may fall back to polling.&lt;/t&gt;
-                        &lt;t hangText=&quot;Definition:&quot;&gt;
-                            &lt;figure&gt;
-                                &lt;artwork&gt;&lt;![CDATA[
-&lt;!ELEMENT xmpp-hearbeat CS:xmpp-heartbeat-uri,
-                        CS:xmpp-heartbeat-minutes&gt;
</del><ins>+                        &lt;t&gt;&quot;key&quot; - the push key of the collection&lt;/t&gt;
+                        &lt;t&gt;&quot;dataChangedTimestamp&quot; - the unix epoch time (in seconds) when the change that triggered this notification took place&lt;/t&gt;
+                        &lt;t&gt;&quot;pushRequestSubmittedTimestamp&quot; - the unix epoch time (in seconds) when the CalDAV/CardDAV server sent the notification to the APNs servers&lt;/t&gt;
+                    &lt;/list&gt;
+                &lt;/t&gt;
+            &lt;/section&gt;
</ins><span class="cx"> 
</span><del>-&lt;!ELEMENT xmpp-hearbeat-uri (#PCDATA) &gt;
-
-&lt;!ELEMENT xmpp-hearbeat-minutes (#PCDATA) &gt;
-
-]]&gt;&lt;/artwork&gt;
-                            &lt;/figure&gt;
-                        &lt;/t&gt;
-                        &lt;t hangText=&quot;Example:&quot;&gt;
-                            &lt;figure&gt;
-                                &lt;artwork&gt;&lt;![CDATA[
-&lt;CS:xmpp-heartbeat&gt;
-  &lt;CS:xmpp-heartbeat-uri&gt;
-     xmlns:CS=&quot;http://calendarserver.org/ns/&quot;&gt;
-     xmpp:pubsub.notifications.example.com?pubsub;
-      node=/Public/CalDAV/notifications.example.com/443/
-  &lt;/CS:xmpp-heartbeat-uri&gt;
-  &lt;CS:xmpp-heartbeat-minutes&gt;30&lt;/CS:xmpp-heartbeat-minutes&gt;
-&lt;/CS:xmpp-heartbeat&gt;
-                   ]]&gt;&lt;/artwork&gt;
-                            &lt;/figure&gt;
-                        &lt;/t&gt;
-                                        &lt;/list&gt;
-                                &lt;/t&gt;
-                        &lt;/section&gt;
</del><span class="cx">         &lt;/section&gt;
</span><span class="cx"> 
</span><span class="cx">     &lt;/middle&gt;
</span><span class="cx">     &lt;back&gt;
</span><span class="cx">         &lt;references title='Normative References'&gt;
</span><span class="cx">             &amp;rfc2119;
</span><del>-            &amp;rfc3920;
-            &amp;rfc4622;
</del><span class="cx">             &amp;rfc4791;
</span><span class="cx">             &amp;rfc4918;
</span><ins>+    &lt;reference anchor='APPLE.APNS' target=' https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html'&gt;
+      &lt;front&gt;
+      &lt;title&gt;Apple Push Notification Service&lt;/title&gt;
+      &lt;author&gt;
+          &lt;organization&gt;Apple Inc.&lt;/organization&gt;
+      &lt;/author&gt;
+      &lt;date month='October' day='16' year='2014' /&gt;
+      &lt;/front&gt;
+
+      &lt;seriesInfo name='Apple Inc' value='iOS Developer Library'/&gt;
+      &lt;format type='HTML' target='https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html' /&gt;
+    &lt;/reference&gt;
</ins><span class="cx">         &lt;/references&gt;
</span><span class="cx">     &lt;/back&gt;
</span><span class="cx"> &lt;/rfc&gt;
</span></span></pre>
</div>
</div>

</body>
</html>