W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2014

Re: Progress on Push API

From: Martin Thomson <martin.thomson@gmail.com>
Date: Thu, 1 May 2014 17:26:49 -0700
Message-ID: <CABkgnnU=iHn=_nGu4CWSMcRJtfa+O2yDXn_exTQeNemfwqjVWw@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: EDUARDO FULLEA CARRERA <efc@tid.es>, Domenic Denicola <domenic@domenicdenicola.com>, public-webapps <public-webapps@w3.org>
On 1 May 2014 16:55, Jonas Sicking <jonas@sicking.cc> wrote:
> function registrationHandler() {
>   navigator.push.register().then((endpoint) => {
>    sendBackToAppServer(endpoint);
>    navigator.push.registrationNeeded.then(registrationHandler);
>   }
> }
> navigator.push.registrationNeeded.then(registrationHandler);

If it's going to happen over and over, why not an event?

function register() {
  navigator.push.register().then(endpoint => sendToAppServer(endpoint));
}
navigator.push.onderegister = e => register;

Of course, you would have to set some expectations around how quickly
the browser is required to detect this error.  30 minutes is a pretty
common liveness interval for these things, which might not meet the
usual timeliness expectations for applications.
Received on Friday, 2 May 2014 00:27:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:24 UTC