Socket
Book a DemoInstallSign in
Socket

@nghinv/react-native-codepush-manage

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nghinv/react-native-codepush-manage

React native codepush manage

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
2
-80%
Maintainers
1
Weekly downloads
 
Created
Source

@nghinv/react-native-codepush-manage

Loading an overlay when running long tasks in the react-native application.

Version MIT License All Contributors

Installation

Installing the package

  • Use yarn
yarn add @nghinv/react-native-codepush-manage
  • Use npm
npm install @nghinv/react-native-codepush-manage
  • peerDependencies
yarn add react-native-code-push react-native-device-info

How to use

Connect with Root Component

you can use withCodePush or CodePushProvider to wrapped Root component

Use withCodePush

  • Connect withCodePush with Root Component
  import { withCodePush } from '@nghinv/react-native-codepush-manage';

  ....

  // Default = {
  //   checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
  //   installMode: codePush.InstallMode.ON_NEXT_RESTART,
  // }
  const codePushOptions = {};

  export default withCodePush(codePushOptions)(RootComponent);

Use CodePushProvider

  • Wrapped CodePushProvider with Root Component
  import { CodePushProvider } from '@nghinv/react-native-codepush-manage';

  ....

  return (
    <CodePushProvider>
      <RootComponent />
    </CodePushProvider>
  )

Use AppVersion

  • Use hook function useCodePush
  const { status, progress } = useCodePush();
  • Use AppVersion component
  import { AppVersion } from '@nghinv/react-native-codepush-manage';


  return (
    <View>
      <AppVersion 
        buildDate='02/09/2021'
        statusTitle={{
          Updating: 'Updating',
          Installing: 'Installing',
          NeedToRestart: 'Need to restart',
        }}
      />
    </View>
  )

Property

AppVersion property

PropertyTypeDefaultDescription
titleStringnullTitle of app version
styleViewStylenullContainer style
titleColorStringnullTitle color
titleStyleTextStylenullTitle style
onPress() => voidnull
enableRestartOnPressBoolnullpress to restart app
enableSyncOnPressBoolnullpress to sync code push
buildDateStringnullApp build date
statusTitleStatusTitleStylenull
titlePropsTextPropsnull

StatusTitleStyle

PropertyTypeDefaultDescription
UpdatingStringUpdating
InstallingStringInstalling
NeedToRestartStringNeed to restart

Credits

Keywords

react-native

FAQs

Package last updated on 01 Sep 2021

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.