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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -