@cfware/before-install-prompt

1.0.0 • Public • Published

@cfware/before-install-prompt NPM Version

Basic module to handle the beforeinstallprompt window event.

Usage

import {promptInstallWait, promptInstallShow} from '@cfware/before-install-prompt';

function readyToShowPrompt() {
  /* This function should display a button on the page which will call
   * promptInstallShow(); when clicked.
   */
  promptInstallShow();
}

promptInstallWait(readyToShowPrompt);

promptInstallWait(callback)

Register a function to be called when promptInstallShow is able to show a prompt.

promptInstallShow()

Show the install prompt if possible. This function will silently fail if it's not possible to show the prompt.

Package Sidebar

Install

npm i @cfware/before-install-prompt

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

5.39 kB

Total Files

5

Last publish

Collaborators

  • coreyfarrell