The process of implementing web push notifications is fairly straightforward: you will need to upload to your website a few lines of code to activate the feature.
Things to know before you start:
- We strongly recommend using HTTPS, as browsers may block notifications from domains using the HTTP protocol.
- If you are not sure whether the website is on HTTP or on HTTPS, please ask your website administrator about it or contact our customer support.
- Using raw device tokens for targeting specific devices is not the most reliable way, because FCM push tokens tend to change from time to time, and it’s hard to tell how often it occurs.
To Call Web Push Notification One-click Subscription Prompt on your website, you need to properly identify your user and fire an event on your web page.
IMPORTANT Include those snippets on every page in your app, immediately before the closing
</body> tag to initialize JS API and identify your user.
Connecting the library:
- Install JS API
- Create and generate a JS code snippet.
- Call “Show web push subscription prompt” modal API method:
||Call Web Push Notification One-click Subscription Prompt on any page or by user action.|
After inserting the code on your site, make your first JS API call and check the integration status.
- Navigate to the Integrations page (Menu -> Integrations).
- Select the “JS code” section.
- When the first successful JS API call is done, the installation will be validated, and the status will change to “Connected.”
- If the website status is “Not connected”, it is necessary to check the applied settings once again.
- If the website status is “Connected”, you will be able to create and update contacts, manage their data and subscription.