3.2.0 • Published 2 months ago

@interopio/browser-worker v3.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

IO Connect Browser Service Worker Module

Overview

@interopio/browser-worker is a library, which is designed to be imported into a service worker file. The library enables the advanced notifications functionality of IO Connect Browser, which requires a Service Worker.

Getting Started

The package can be added to a service worker file in two ways. One is by using the importScripts() method attached to the self global object in the Service Worker scope. The library will then define and attach to the self object a number of stateless functions.

The other way is to import the package just like any other JS package in your existing service worker project. Then you can build it and the output should be a single .js file, ready to be registered as a service worker.

Usage

The library gives access to three functions:

  • self.IOWorker or default export - this function initializes the package and registers the necessary event listeners to correctly capture and process notification clicks
  • self.openBrowserPlatform or {openBrowserPlatform} - this function accepts a url and will open and wait for the platform app to be fully operational
  • self.raiseIONotification or {raiseIONotification} - this function accepts a IO Connect Browser notification settings object and will raise the notification.
3.2.0

2 months ago

3.1.1

2 months ago

3.1.0

6 months ago

3.0.3

6 months ago

3.0.2

8 months ago

3.0.1

8 months ago

3.0.0

8 months ago