Direct Push
Click Channel > Web Push > Direct Push to start setup.


Description | |
---|---|
Website Name | Website name will be auto-filled when message title is left blank |
Website URL | Input the exact website address for SDK integration. If the URL does not match, web push will not work. The following URLs are also supported based on the URL you entered:
|
If there is no existing ServiceWorker file in use, create a new file named
sw.js
. If there is already a file in use, open it in an editor.Add the following script to the ServiceWorker file.
sw.js
importScripts('https://cdn.flarelane.com/ServiceWorker.js');
Upload the ServiceWorker file at the root path of the website.
(ex. If the file sw.js is located in the 'example.com' domain, it should be accessible at example.com/sw.js)
You can check your project ID at FlareLane console's Project
Add the following script right before the </body> tag of your website.
<script src="https://cdn.flarelane.com/WebSDK.js" charset="UTF-8"></script>
<script>
FlareLane.initialize({
projectId: "PROJECT_ID",
// If there is a Service Worker with a different name
// serviceWorkerPath: '/otherServiceWorker.js'
});
</script>

If everything has been set up correctly, a prompt asking for permission to subscribe will appear when the website is refreshed.
Then, you can proceed with the detailed setting such as the setting up an icon at FlareLane console's Channel > Web Push.
Last modified 11d ago