On Thursday, July 25, 2013 8:37:40 AM UTC-7, Michael Diener wrote:
> One last thing: This also happens for packaged apps, just tested it.
>
>
>
>
>
> On Thursday, July 25, 2013 5:30:52 PM UTC+2, Michael Diener wrote:
>
> > I did a bit more research and the problem seems to be that the files
> > defined under "messages" in the manifest do net get called if the app is
> > not running.
>
> >
>
> >
>
> >
>
> > This is not just about Simple Push, but also happens for alarms through
> > MozAlarmsManager:
>
> >
>
> >
>
> >
>
> > "messages": [
>
> >
>
> > { "alarm": "/push-message.html" }
>
> >
>
> > ],
>
> >
>
> >
>
> >
>
> > The file is never called when the alarm should trigger. Is there a general
> > issue with the system messaging?
>
> >
>
> >
>
> >
>
> > According to the spec ( http://runtime.sysapps.org/#system-messages ) the
> > app should be started when not running, but again, this does not happen:
>
> >
>
> > "... Otherwise, if the application is not running, the UA must add the
> > message to the pool of messages and start the application ..."
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > On Thursday, July 25, 2013 1:48:21 PM UTC+2, Michael Diener wrote:
>
> >
>
> > > I'm able to get an endpoint successfully, but after that the issues start.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > The "messages" attribute from the manifest gets ignored or at least the
> > > files listed there will never be called (no matter what they contain):
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > "messages": [
>
> >
>
> > >
>
> >
>
> > > { "push": "/ff/push-message.html"},
>
> >
>
> > >
>
> >
>
> > > { "push-register": "/ff/push-message.html"}
>
> >
>
> > >
>
> >
>
> > > ],
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Normally the following code would be within push-message.html (as
> > > suggested by the official Simple Push example):
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > window.navigator.mozSetMessageHandler('push', function(e) {
>
> >
>
> > >
>
> >
>
> > > console.log("endpoint reached");
>
> >
>
> > >
>
> >
>
> > > });
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > But as push-message.html never gets called, I put it instead in my main
> > > page and the handler gets successfully called. The downside to this is
> > > that it only gets called, if the app is in memory (in fore- or
> > > background). If it is not (e.g. if device just started and app was not
> > > started yet), nothing is called.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Am I doing something wrong or are these 2 issues known bugs or even
> > > limitations?
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > This is about a hosted app (not a packaged app) in case it matters.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Thanks,
>
> >
>
> > >
>
> >
>
> > > Michael
Hey Michael,
Until Bug 800431 is fixed, system messages can only be delivered to the page
that signed up for a particular API. That is, only the page which called
navigator.push.register() or mozAlarms.add() will receive the corresponding
system message. Please let us know if switching to one page works.
Best,
Nikhil
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g