-
Notifications
You must be signed in to change notification settings - Fork 0
/
25_push_notifiations.xml
71 lines (62 loc) · 2.14 KB
/
25_push_notifiations.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<document>
<title>Push Notifications</title>
<position>24</position>
<section>
<docs>
<![CDATA[
The server sends push notifications so clients can update in realtime.
There are two different channels. One for realtime updates to records
and one for the feed. You may only subscribe to channels for a specific user.
There are no global channels. The server only sends push notifications for records
the user can access. This follows the principle that the API only shows you
what a user has access to.
The general format for a channel is like this: `/name/user-api-key`.
Replace "user-api-key" with a user.
The client is only allowed to receive message.
]]>
</docs>
</section>
<section title="Update Channel">
<docs>
<![CDATA[
### Channel: /updates/user-api-key
The update channel pushes out all create, update and delete actions.
Each message contains the action and the record itself. The enire record
is sent in each message. For example, the complete record is sent on update
and **not** just the changes. This is so the client can pull in a complete record
if they don't have it in memory already.
<dl>
<dt>action</dt>
<dd>Either: <code>create</code>, <code>update</code>, or <code>delete</code></dd>
<dt>resource</dt>
<dd>The name of the resource type. Example: <code>user</code></dd>
<dt>data</dt>
<dd>The raw data</dd>
</dl>
When a record is deleted, only the ID is given in `data`.
]]>
</docs>
<reference>
<![CDATA[
### Channel: /updates/user-api-key
```javascript
{
"action": "update",
"resource": todo",
"data": { ... }
}
```
]]>
</reference>
</section>
<section title="Feed Channel">
<docs>
<![CDATA[
### Channel: /feed/user-api-key
The feed channel receives everything that comes into the user's feed.
New entries are sent when they are added or changed. Each message is in the
`Activity` format.
]]>
</docs>
</section>
</document>