Notifications #
The realtime:subscribe method takes a listener of type kuzzleio::NotificationListener
. That listener is called with a const kuzzleio::notification_result*
argument, pointing to an object whose content depends on the type of notification received.
Document & messages #
These kuzzleio::notification_result
represent documents changes & messages.
Property | Type | Description |
---|---|---|
action | const char* | API controller's action |
collection | const char* | Collection name |
controller | const char* | API controller |
index | const char* | Index name |
protocol | const char* | Network protocol used to modify the document |
result | kuzzleio::notification_content* | Notification content |
room_id | const char* | Subscription channel identifier. Can be used to link a notification to its corresponding subscription |
scope | const char* | in : document enters (or stays) in the scopeout : document leaves the scope |
timestamp | unsigned long long | Timestamp of the event, in Epoch-millis format |
n_type | const char* | document : the notification type |
volatiles | const char* | JSON String representing request volatile data |
The kuzzleio::notification_content
struct has the following properties for document notifications & messages:
Property | Type | Description |
---|---|---|
id | const char* | Document unique IDnull if the notification is from a real-time message |
content | const char* | JSON String representing the message or the full document content. Not present if the event is about a document deletion |
User #
These kuzzleio::notification_result
represent user events.
Property | Type | Description |
---|---|---|
action | const char* | API controller's action |
collection | const char* | Collection name |
controller | const char* | API controller |
index | const char* | Index name |
protocol | const char* | Network protocol used by the entering/leaving user |
result | kuzzleio::notification_content* | Notification content |
room_id | const char* | Subscription channel identifier. Can be used to link a notification to its corresponding subscription |
timestamp | unsigned long long | Timestamp of the event, in Epoch-millis format |
n_type | const char* | user : the notification type |
user | const char* | in : a new user has subscribed to the same filtersout : a user cancelled a shared subscription |
volatiles | const char* | JSON String representing request volatile data |
The kuzzleio::notification_content
struct has the following properties for document notifications & messages:
Property | Type | Description |
---|---|---|
count | int | Updated users count sharing that same subscription |