Changes

Jump to: navigation, search

CloudServices/Presence

1,032 bytes added, 10:47, 26 November 2013
6. Live notifications
=== 6. Live notifications ===
XXX encryption ?Live notifications are a way for applications to reach out online users that are not active in the application. It can be used to give the opportunity to the user to react when something is happening in the application.
Live notifications are a way for applications to reach out online users thatare not active in the application.Examples:
Like status updates, live notifications are done via '''ws* ChatRoom://presenceYour nick was used in a message sent to the room.services.mozilla.com/presence'''* ChatRoom: Someone wants you to join the room.
The application AppService sends a notification notifications to Mozilla Presence via a POST requestcontaining :
POST https://<node>.presence.mozilla.com/<appid>/notification
[{'UID': 'userid',
'message': '<message>',
'urlaction': '<url>'}, ... ] AppService can send notifications by batches. Details:
Each * ''userid'': the user gets its own messaging queue and ID provided by the presence system.* ''message '': a message to display to the user. Limited to 512 chars.* ''action'': an action that will be discarded after 5 minutes happen on the device if not consumed by the useragrees - it can be an url to visit or an application to run. Limited to 512 chars.
If Mozilla Presence pushes the message into a FIFO queue. There's one queue per user id + app id combination, and its sizeis connected on '''ws://presencelimited to 100 items.servicesWhen the queue is full, the oldest item is dropped before the new item is added.mozilla.com/presenceFor each item, it appends in the mapping the ''appid'' - the messages will be dequeued and pushed therevalue.
Once the message is stored, the service sends back an ack message to AppService, with the
current size of the queue:
XXX implementation of desktop UI {'result': 'OK', see https 'queue_size'://developer<size>} Receiving the ack is a guarantee that the message was stored on the server, butis not a guarantee that it was delivered to the user.mozilla If the user is connected to Mozilla Presence via the Presence daemon, it gets all the items from the queue and the queue is purged.org/en-US/docs/Social_API/Widgets#Notification_Panels
The Presence daemon on the device is responsible to dispatch the messages to
the different applications:
* '''on desktop''', it displays a notification with the url contained in the action for the user to click
* '''on mobile''', it displays a notification with a link to run the app XXX
<!-- ==API Reference/Documentation===== Data Schema ===<i>How will data be stored</i>=== API ===<i>How to call The application has no feedback on whether a notification was seen by the data</i>==== <i>method</i> <i>URI</i> ====<i>description</i>user.
Arguments <i>argument descriptions<XXX implementation of desktop UI, see https://i> Returns: <i>returned contents<developer.mozilla.org/i>en-->US/docs/Social_API/Widgets#Notification_Panels
==Platform Requirements==
Confirm
927
edits

Navigation menu