Web Push
Empower your web application with Antsomi WebPush to deliver impactful notifications, fostering effective engagement and communication. Web push notifications offer a dynamic avenue for timely, personalized, and efficient information delivery, enhancing user interactions with your website.
To kickstart the integration of Antsomi WebPush, follow these steps to load the SDK asynchronously. This ensures optimal page load times and a seamless integration process.
Initialization
Antsomi WebPush recommends loading webpush.js
with the async
flag so your page load times don't increase. To use it, place the following code before calling any other Antsomi WebPush functions.
Adding Service Worker
What are Service Workers?
Web Push Notifications, excluding Safari, require Service Worker files on your domain for subscription and notification reception. These files are downloaded upon accepting web notifications.
Integrating Antsomi WebPush Service Worker Files
Download
sw.js
Files: linkAdd Service Workers to the Website: The
sw.js
file must be publicly accessible and can be placed at the top-level root of your site, e.g., https://example.com/sw.js.
Last updated