Sending Push API messages with payload in Java

Hello there.

I want to send push messages to my website users using the newly added Push API.
Can I get assistance on how to correctly encrypt my messages in Java?
Is there maybe a tutorial that can be followed somewhere?
Ultimately I want to use these push notifications on my Firefox extension.

Thanks in advance.
João Dias

1 Like

To use the push notification system from add-ons one way is like this:

 Cc['@mozilla.org/alerts-service;1'].getService(Ci.nsIAlertsService).showAlertNotification('path/to/icon.png', 'TITLE', 'BODY', false, null, null);

You can read about this here - https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Alerts_and_Notifications

For push notifications from a website I think that info is here -

Thanks, but that refers to notifications. I’m looking for a way to push data from my server to a website or extension. thanks again!