Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-code-push

Package Overview
Dependencies
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-code-push

React Native plugin for the CodePush service

  • 9.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
122K
increased by3.43%
Maintainers
2
Weekly downloads
 
Created

What is react-native-code-push?

react-native-code-push is a React Native module that allows developers to deploy mobile app updates directly to users' devices. This includes JavaScript code and assets, which can be updated without requiring a full app store release. This can significantly speed up the release cycle and improve the user experience by delivering bug fixes and feature updates more quickly.

What are react-native-code-push's main functionalities?

Code Push Integration

This code demonstrates how to integrate CodePush into a React Native application. By wrapping the main app component with CodePush, you enable the app to check for updates and apply them.

import CodePush from 'react-native-code-push';

class MyApp extends Component {
  render() {
    return <App />;
  }
}

MyApp = CodePush(MyApp);

export default MyApp;

Manual Update Check

This code sample shows how to manually check for updates using a button. When the button is pressed, the app will check for updates and apply them immediately if available.

import CodePush from 'react-native-code-push';

class MyApp extends Component {
  checkForUpdates = () => {
    CodePush.sync({
      updateDialog: true,
      installMode: CodePush.InstallMode.IMMEDIATE
    });
  };

  render() {
    return (
      <View>
        <Button title="Check for updates" onPress={this.checkForUpdates} />
        <App />
      </View>
    );
  }
}

export default CodePush(MyApp);

Custom Update Dialog

This code sample demonstrates how to customize the update dialog that appears when an update is available. You can customize the title, message, and button labels to better fit your app's design and user experience.

import CodePush from 'react-native-code-push';

class MyApp extends Component {
  checkForUpdates = () => {
    CodePush.sync({
      updateDialog: {
        appendReleaseDescription: true,
        descriptionPrefix: "\n\nChange log:\n",
        title: "Update available",
        mandatoryUpdateMessage: "An update is available that must be installed.",
        mandatoryContinueButtonLabel: "Continue",
      },
      installMode: CodePush.InstallMode.IMMEDIATE
    });
  };

  render() {
    return (
      <View>
        <Button title="Check for updates" onPress={this.checkForUpdates} />
        <App />
      </View>
    );
  }
}

export default CodePush(MyApp);

Other packages similar to react-native-code-push

Keywords

FAQs

Package last updated on 10 Sep 2024

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc