How to use react-native-version-check - 7 common examples

To help you get started, we’ve selected a few react-native-version-check examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kimxogus / react-native-version-check / packages / react-native-version-check-expo / index.js View on Github external
// @flow
import builder from 'react-native-version-check/builder';
import VersionInfo from './src/ExpoVersionInfo';

export default builder(VersionInfo);
github kimxogus / react-native-version-check / examples / reactnative / App.js View on Github external
componentDidMount() {
    VersionCheck.needUpdate({
      latestVersion: '1.0.0',
    }).then(res => this.setState(res));

    VersionCheck.getStoreUrl({ appID: '364709193' }).then(res => {
      //App Store ID for iBooks.
      this.setState({ storeUrl: res });
    });
  }
  render() {
github redbadger / pride-london-app / src / components / StoreVersionDialog.js View on Github external
handleAppStoreLink = async () => {
    try {
      Linking.openURL(
        await VersionCheck.getStoreUrl({ appName: appNameIos, appID: appIdIos })
      );
    } catch (e) {
      this.props.onError(e);
    }
  };
github redbadger / pride-london-app / src / components / StoreVersionDialog.js View on Github external
async componentDidMount() {
    const versionInfo: VersionInfo = await VersionCheck.needUpdate();
    const askLaterTime = await getAppUpdateAskLaterTime();
    const updateMessageSuppressed =
      !!askLaterTime && isBefore(now(), askLaterTime);

    const showAppStoreAlert = versionInfo.isNeeded && !updateMessageSuppressed;
    if (showAppStoreAlert) {
      this.handleAppStoreAlert();
    }
  }
github kimxogus / react-native-version-check / examples / reactnative / App.js View on Github external
componentDidMount() {
    VersionCheck.needUpdate({
      latestVersion: '1.0.0',
    }).then(res => this.setState(res));

    VersionCheck.getStoreUrl({ appID: '364709193' }).then(res => {
      //App Store ID for iBooks.
      this.setState({ storeUrl: res });
    });
  }
  render() {
github celo-org / celo-monorepo / packages / mobile / src / invite / saga.ts View on Github external
export async function generateLink(inviteCode: string, recipientName: string) {
  const packageName = VersionCheck.getPackageName().replace(/\.debug$/g, '.integration')
  const playStoreLink = await VersionCheck.getPlayStoreUrl({ packageName })
  const referrerData = encodeURIComponent(`invite-code=${inviteCode}`)
  const referrerLink = `${playStoreLink}&referrer=${referrerData}`
  const shortUrl = await dynamicLink(referrerLink)
  const msg = i18n.t('sendFlow7:inviteSMS', {
    name: recipientName,
    code: inviteCode,
    link: shortUrl,
  })

  return msg
}
github celo-org / celo-monorepo / packages / mobile / src / invite / saga.ts View on Github external
export async function generateLink(inviteCode: string, recipientName: string) {
  const packageName = VersionCheck.getPackageName().replace(/\.debug$/g, '.integration')
  const playStoreLink = await VersionCheck.getPlayStoreUrl({ packageName })
  const referrerData = encodeURIComponent(`invite-code=${inviteCode}`)
  const referrerLink = `${playStoreLink}&referrer=${referrerData}`
  const shortUrl = await dynamicLink(referrerLink)
  const msg = i18n.t('sendFlow7:inviteSMS', {
    name: recipientName,
    code: inviteCode,
    link: shortUrl,
  })

  return msg
}