Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

react-pwa-install-prompt

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Issues
File Explorer

Advanced tools

react-pwa-install-prompt

A react hook to prompt the install of your PWA in supported browers (Chrome desktop & mobile)

    1.0.5latest

Version published
Maintainers
1
Weekly downloads
187
increased by5.65%

Weekly downloads

Readme

Source

react-pwa-install-prompt

A react hook to prompt the install of your PWA in supported browsers (Chrome desktop & mobile)

NPM JavaScript Style Guide

Install

yarn add react-pwa-install-prompt

Usage

import React from 'react' import usePWA from 'react-pwa-install-prompt' const Example = () => { const { isStandalone, isInstallPromptSupported, promptInstall } = usePWA() const onClickInstall = async () => { const didInstall = await promptInstall() if (didInstall) { // User accepted PWA install } } const renderInstallButton = () => { if (isInstallPromptSupported && isStandalone) return ( <button onClick={onClickInstall}>Prompt PWA Install</button> ) return null } return (<div> <h2>PWA Infos</h2> <p>Is Install Prompt Supported ? {isInstallPromptSupported ? 'true' : 'false'}</p> <p>Is Standalone ? {isStandalone ? 'true' : 'false'}</p> {renderInstallButton()} </div>) } export default Example

License

MIT © eric-edouard

FAQs

What is react-pwa-install-prompt?

A react hook to prompt the install of your PWA in supported browers (Chrome desktop &amp; mobile)

Is react-pwa-install-prompt popular?

The npm package react-pwa-install-prompt receives a total of 174 weekly downloads. As such, react-pwa-install-prompt popularity was classified as not popular.

Is react-pwa-install-prompt well maintained?

We found that react-pwa-install-prompt demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.

Last updated on 04 Oct 2020
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc