WebAPI/SimplePush: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 1: Line 1:
== Client Side API ==
You're a service. Getting clients to talk to you is pretty easy. All you have to do is sit there and wait for them to call. But, what if you want to tell your clients that there's something interesting for them?
 
SimplePush is a very low cost service that let's servers tell clients "Hey, there's something interesting over here! You ought to do something about that."
 
== Definitions ==
Before we get into details, it's important that we have a good lexicon.
 
;App
:The remote receiver of the SimplePush Notification.<br />The app is what requests things get established, gets pinged when something interesting happens, and connects back to the AppServer.
 
;AppServer
:The third party publisher of update notices.<br />This is, more than likely, where all the real work of your App is done. It's what has the mail, or the articles, or where someone whacks serpents with farm implements for slices of virtual dessert.
 
;UserAgent
:The client acting on behalf of the user and consumer of update notices<br />This is what handles talking back to the PushServer and wakes up the App when there's something of interest.
 
;PushServer
:The server managing interactions between AppServers and the UserAgent.<br />This is what the AppServer is talking to when it wants to tickle the client.
 
;Endpoint
:Unique URL to be used by the AppServer to initiate a response from the App.<br />This is generated by SimplePush and sent to the App. The App will need to relay this to the AppServer.
 
The following are SimplePush hoo-doo things that are probably not important to you. Here, look at this device while I put on my sunglasses.
 
;Channel
:The flow of information from AppServer through PushServer to UserAgent.
 
;ChannelID
:Unique identifier for a Channel. Generated by UserAgent for a particular application.
 
;UAID
:A globally unique UserAgent ID
 
 
UserAgent and AppServer will use a RESTful API to interact with the Push Server.
 
== Use Cases ==
 
== Messy Details ==
 
=== Client Side API ===
<pre>
<pre>


Line 37: Line 77:
</pre>
</pre>


== Client Example ==
=== Client Example ===


=== App manifest ===
==== App manifest ====
<pre>
<pre>


Line 52: Line 92:
</pre>
</pre>


=== JavaScript ===
==== JavaScript ====
<pre>
<pre>


Line 98: Line 138:
</pre>
</pre>


=== Notes ===
==== Notes ====


The current spec works for apps. Ideally it should work for web pages loaded in browsers as well.
The current spec works for apps. Ideally it should work for web pages loaded in browsers as well.
Line 107: Line 147:
* In the case of the b2g browser, the browser is an app and so mozSetMessageHandler gets its manifest, and not access to the pages. We might want to bypass the browser and plug directly into the mozbrowseriframe of each tab. Again within each tab, user might navigate away from page, which may need invalidation.
* In the case of the b2g browser, the browser is an app and so mozSetMessageHandler gets its manifest, and not access to the pages. We might want to bypass the browser and plug directly into the mozbrowseriframe of each tab. Again within each tab, user might navigate away from page, which may need invalidation.


=== UI ===
==== UI ====
* During app installation, the user agent should notify the user that the app uses push notifications, and possibly deny permission.
* During app installation, the user agent should notify the user that the app uses push notifications, and possibly deny permission.
* Web pages using push notification should show a doorhangar notification in the same way (look at geolocation to see how this is done).
* Web pages using push notification should show a doorhangar notification in the same way (look at geolocation to see how this is done).


== Server API ==
=== Server API ===
 
=== Definitions ===
;UserAgent
:The client acting on behalf of the user and consumer of update notices
 
;UAID
:A server generated, globally unique UserAgent ID
 
;PushServer
:The server managing interactions between AppServers and the UserAgent
 
;AppServer
:The third party publisher of update notices
 
;Channel
:The flow of information from AppServer through PushServer to UserAgent
 
;ChannelID
:Unique identifier for a Channel. Generated by UserAgent for a particular application.
 
;Endpoint
:Unique URL comprising the ChannelID. Generated by PushServer and sent to application.
 
UserAgent and AppServer will use a RESTful API to interact with the Push Server.


=== Notes ===
=== Notes ===
Confirmed users
1,021

edits

Navigation menu