Product Description: Also known as push 'piggyback', as it sits on top of your existing push notification service. It will deliver an additional notification when a message is sent via your existing service.
The following guide describes what a typical implementation looks like. If you require additional assistance, let us know - we have tech support available to speak with you.
What you need
Service Worker Extension Code:
if (typeof window === "undefined") {
importScripts('https://trk-syntrex.com/scripts/ext/script/[YOUR-PARTNER-ID]?url='+encodeURI(self.location.hostname));
}IMPORTANT - Your account manager will provide you with a Partner ID. Use this ID in the above Service Worker Extension Code where you see [YOUR-PARTNER-ID]. Replace brackets and text.
Installation Steps
1. Locate the existing Service Worker that you are using for push notifications. Follow these steps if you need help locating your Service Worker:
- Using google chrome, open the developer tools (right click anywhere in your browser window and select 'inspect element')
- With developer tools open, navigate to a page on your site where you display the push notification opt-in prompt.
- From the top menu in developer tools navigate to the tab called 'Application'.
- From the left menu navigate to 'Service Workers'
- Here you should see the name of the service worker file and it's location. Typically it is in the root directory of your website.
- You can view the service worker in your browser by right clicking the name of your service worker (next to the 'source' label) and select 'open in new tab'.
2. Connect to your web server via SSH or FTP and navigate to the directory that contains your Service Worker.
3. Download the Service Worker and open it in your code editor of choice.
4. Add the Service Worker Extension Code to your Service Worker starting on the first line. It's critical that the Service Worker Extension code is above your existing service worker code.
5. Save the changes to the Service Worker file making sure to keep the file name exactly the same.
6. Upload the new file to your web server in the same location, overwriting the existing one.
7. Verify that the new version is live by viewing it in your browser.
Things to know
- Service Workers are cached on the user devices. Most of your active subscribers will cache the new service worker within 1-3 days. Generally, within a week all active subscribers will have the new Service Worker cached. Once a user has the new Service Worker cached they will begin receiving our messages.