Web Push

Confluence Documenation


Display subscription prompt with a link.

SUBSCRIBE

<a onclick="_ltk.WebPush.RequestWebPushPermission();">SUBSCRIBE</a>

Display subscription prompt with a button.

<button onclick="_ltk.WebPush.RequestWebPushPermission();">SUBSCRIBE</button>

Display subscription prompt with an image.

<a onclick="_ltk.WebPush.RequestWebPushPermission();"><img src="Image URL"></a>

The following elements are hidden because you have already subscribed.

The following elements will be hidden for visitors that have already subscribed.


SUBSCRIBE



Prevent the element that will trigger the sub prompt from displaying for visitors that have already subscribed using the following javascript checks. This will be implemented depending on your website UI framework.


                    function IsSubscribed() {
                        _ltk.WebPush.IsSubscribed()
                            .then((subscribed) => {
                                if (subscribed === true) {
                                    // Hide elements
                                }
                            });
                    }
                

The following elements will be hidden on unsupported browsers/devices.


SUBSCRIBE



Prevent the element that will trigger the sub prompt from displaying on unsupported browsers/devices using the following javascript checks. This will be implemented depending on your website UI framework.


                    function SupportedWebBrowser() {
                        if (_ltk.WebPush.IsSupportedBrowser() === false) {
                            // Hide elements
                        } 
                    }
                

The following elements are hidden because you are on an unsupported browser.