1.1.1 • Published 3 years ago

@nghinv/react-native-codepush-manage v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@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

1.1.1

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago