Socket
Socket
Sign inDemoInstall

react-native-store-version

Package Overview
Dependencies
1
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-store-version

This module check an app's version on google playstore or ios app store. By writing code successfully, you can make a forced update.


Version published
Weekly downloads
3.9K
decreased by-20.12%
Maintainers
1
Install size
35.0 kB
Created
Weekly downloads
 

Readme

Source

react-native-store-version

This module check an app's version on google playstore or ios app store.
By writing code successfully, you can make a forced update.

I've only been updating occasionally, but I'd be happy to sponsor you to keep me motivated. https://github.com/sponsors/watanabeyu

Installation

$ npm install --save react-native-store-version

CHANGELOG

v1.4.0

v1.3.0

  • if failed, throw an error.
  • add result detail.

Usage

import checkVersion from 'react-native-store-version';

export default function App() {
  useEffect(() => {
    const init = async () => {
      try {
        const check = await checkVersion({
          version: '1.0.0', // app local version
          iosStoreURL: 'ios app store url',
          androidStoreURL: 'android app store url',
          country: 'jp', // default value is 'jp'
        });

        if (check.result === 'new') {
          // if app store version is new
        }
      } catch (e) {
        console.log(e);
      }
    };

    init();
  }, []);
}

Return value

// correct
{
  local: "1.0.0",
  remote: "1.1.0",
  result: "new", // "new" | "old" | "equal"
  detail: "remote > local", // "remote > local" | "remote < local" | "remote === local"
}

// catch error
{
  message: "string",
}

result compare from a local to remote.
If local(1.0.0) and remote(1.1.0), result is new.

Example

Check out example on snack

Keywords

FAQs

Last updated on 11 Mar 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc