>> var mozMM = navigator.mozMobileMessage;
>>      mozMM.addEventListener('received', function addEventListener(evt) {
>>           // Display a alert when a message comes in
>>           $window.alert('SMS received');
>>           $window.alert(evt.message.body);
>>      }, false);
>>
> This is wrong, here you need a system message handler:
>
>       navigator.mozSetMessageHandler('sms-received', function
> onSMS(sms) {
>         /* here your code */
>       });
>
> Use this for any system message you use and remember that, on some APIs
> (i.e. alarms), you can only receive the alarm in the same page you
> installed it.

Basically, adding the "sms-received" message in manifest.webapp will
make Firefox OS run your app if it's not already running when this
message needs to be sent, ie when we receive a SMS here.

Of course, setting the message handler is what gets you called in the end.

-- 
Julien

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to