firefox - Show notifications when app is closed -


i'm having problems notifications in app.

i've seen pages reference alarmapi in firefox os , how handle notifications:

the code same in both cases , works when app open or in background. if close app doesn't show notifications. i've tested example app second link , works when app closed.

what problem , how can fix it?

thanks.

you must use navigator.mozsetmessagehandler() https://developer.mozilla.org/en-us/docs/web/api/navigator.mozsetmessagehandler

 if(navigator.mozsetmessagehandler) {    navigator.mozsetmessagehandler("alarm", function (alarm) {    // launch notification if alarm of right type app    if(alarm.data.task) {     // create notification when alarm due     new notification("your task " + alarm.data.task + " due!");     updatenotified(alarm.data.task);   }   });   } 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -