To ensure web push notifications function correctly after updating the SDK via NPM, follow these critical integration steps:
-
Update the NPM Package Ensure you are installed the latest version of the
pushwoosh-web-notifications-sdkpackage. - Integrate the Subscription Widget Important: In newer versions of the SDK, integrating the widget is mandatory for requesting subscription permissions. Even if you implement your own request logic, the widget must be connected.
-
Service Worker Setup
- During your project build, ensure that the
pushwoosh-service-worker.jsfile from the updated NPM package is copied to the root directory of your website. - The file must be publicly accessible at
https://yoursite.com/pushwoosh-service-worker.js. - Documentation: Service Worker Setup
- During your project build, ensure that the
-
Initialization In your Pushwoosh initialization code, add the
serviceWorkerUrlparameter to explicitly point to the path of your service worker file.
Default Widget Behavior
- Reappearance: If a user ignores the widget or clicks "Block" (within the widget interface, not the browser prompt), it will reappear after 4 hours.
- Limit: After 3 consecutive displays without a subscription, the widget will stop appearing automatically.
Comments
0 comments
Please sign in to leave a comment.