npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-pwa-install-ios

v1.4.3

Published

React component displays a simple popup for PWA app install on iOS.

Downloads

330

Readme

react-pwa-installer-ios

This simple utils React component allows you to easily display a POPUP for your iOS users, informing that they can install your awesome Progressive web app on their phone.

This component integrate the following logic:

  • The popup prompts only on iOS devices (iphones, ipads)
  • The popup shows only if the app is not running in standalone mode (this means user already installed the PWA)
  • When the user clicks anywhere, the popup is closed
  • Once the popup is closed Pop up won't open up for the next 10 days (timestamp is stored in localstorage.)

Example on IPHONE device: demo on iphone

Example on IPAD device: The popup prompts on the top right hand corner to match the 'share button' position: demo on ipad

getting started

npm install -s react-pwa-install-ios
or
yarn add react-pwa-install-ios

Then in your app:

import PwaInstallPopupIOS from 'react-pwa-install-ios';

const MyComponent = () => {
  return (
    <PwaInstallPopupIOS 
      delay={3}
      lang="en"
      appIcon="https://my/icon/url.png">
    </PwaInstallPopupIOS>
  );
};

You can also setup your own content for the pop up:

  <PwaInstallPopupIOS>
    <div 
      delay={0}
      style={{
        padding: '15px 30px',
        backgroundColor: 'blue',
        color: 'white',
        textAlign: 'center',
      }}
    > 
      Hey ! I am the PwaInstallPopupIOS component.
      without the 'force=true' props, I will display only on iOS device,
      not in standalone mode.
    </div>
  </PwaInstallPopupIOS>

Modules available props

  • delay (number): number of seconds to wait for the popup to be displayed.
  • force (boolean): set to true to force the display of the popup on any client, even non apple/safari device. This can be usefull for development / testing purpose.
  • style (object): set custom style the popup container
  • lang (string): language for which to display the modal default content. Currently supported: 'fr', 'en'.

Run locally and contribute

  • clone repo
  • yarn install
  • Test component by launching storybook with yarn storybook
  • Feel free to add any new language defined in locales.js
  • Suggest any improvement by submitting a Pull request !

contributors

Guillaume Gustin