Closed Bug 1131655 Opened 9 years ago Closed 6 years ago

mozAlarms and simplepush should report errors when registering with bad application setup

Categories

(Core :: DOM: Device Interfaces, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: rik, Unassigned)

Details

To receive alarms or simple push messages, a lot of conditions have to be met:

- You need to ask for the permissions in the manifest
- You need to declare where to send messages in the manifest
- You need to set an alarm or register an endpoint at the same URL that will receive the message (this is especially tricky)

If you fail to do all those 3 things, you will not receive the system message and you have no idea why. I got bitten by this twice and the first time I was lucky to sit next to people who implemented it.

I think navigator.push.register() and navigator.mozAlarms.add() should fail if those 3 conditions are not met. This will make app developers' lives much simpler.
I just hit similar issues with navigator.sync, so I would have appreciated this sort of requirements check.

I missed setting a "messages" entry in the manifest, so did not get mozSetMessageHandler('request-sync'...) calls. That API is further complicated by the navigator.sync taking a wakeUpPage URL that would be the entry point for the wakeup, so could be unclear the "messages" entry point was needed.
Cleaning up Device Interfaces component, and mass-marking old FxOS bugs as incomplete.

If any of these bugs are still valid, please let me know.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.