# rntpc_react-native-code-push **Repository Path**: openharmony-sig/rntpc_react-native-code-push ## Basic Information - **Project Name**: rntpc_react-native-code-push - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: https://gitee.com/openharmony-sig/rntpc_react-native-code-push - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2024-10-14 - **Last Updated**: 2025-05-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🚨 **重要提示 | IMPORTANT** > > **⚠️ 此代码仓已归档。新地址请访问 [rntpc_react-native-code-push](https://gitcode.com/openharmony-sig/rntpc_react-native-code-push)。| ⚠️ This repository has been archived. For the new address, please visit [rntpc_react-native-code-push](https://gitcode.com/openharmony-sig/rntpc_react-native-code-push).** > --- > [![appcenterbanner](https://user-images.githubusercontent.com/31293287/32969262-3cc5d48a-cb99-11e7-91bf-fa57c67a371c.png)](http://microsoft.github.io/code-push/) #### [Sign up With App Center](https://appcenter.ms/signup?utm_source=CodePush&utm_medium=Azure) to use CodePush # React Native Module for CodePush *Note: This README is only relevant to the latest version of our plugin. If you are using an older version, please switch to the relevant tag on [our GitHub repo](https://github.com/microsoft/react-native-code-push) to view the docs for that particular version.* ![Switching tags](https://user-images.githubusercontent.com/42337914/57237511-0835de80-7030-11e9-88fa-64eb200478d0.png) This plugin provides client-side integration for the [CodePush service](https://microsoft.github.io/code-push/), allowing you to easily add a dynamic update experience to your React Native app(s). * [How does it work?](#how-does-it-work) * [Supported React Native Platforms](#supported-react-native-platforms) * [Supported Components](#supported-components) * [Getting Started](#getting-started) * [iOS Setup](docs/setup-ios.md) * [Android Setup](docs/setup-android.md) * [Windows Setup](docs/setup-windows.md) * [Plugin Usage](#plugin-usage) * [Store Guideline Compliance](#store-guideline-compliance) * [Releasing Updates](#releasing-updates) * [Multi-Deployment Testing](#multi-deployment-testing) * [Android](docs/multi-deployment-testing-android.md) * [iOS](docs/multi-deployment-testing-ios.md) * [Dynamic Deployment Assignment](#dynamic-deployment-assignment) * [API Reference](#api-reference) * [JavaScript API](docs/api-js.md) * [Objective-C API Reference (iOS)](docs/api-ios.md) * [Java API Reference (Android)](docs/api-android.md) * [Debugging / Troubleshooting](#debugging--troubleshooting) * [Example Apps / Starters](#example-apps--starters) * [Continuous Integration / Delivery](#continuous-integration--delivery) * [TypeScript Consumption](#typescript-consumption) ## How does it work? A React Native app is composed of JavaScript files and any accompanying [images](https://reactnative.dev/docs/image), which are bundled together by the [metro bundler](https://github.com/facebook/metro) and distributed as part of a platform-specific binary (i.e. an `.ipa` or `.apk` file). Once the app is released, updating either the JavaScript code (e.g. making bug fixes, adding new features) or image assets, requires you to recompile and redistribute the entire binary, which of course, includes any review time associated with the store(s) you are publishing to. The CodePush plugin helps get product improvements in front of your end users instantly, by keeping your JavaScript and images synchronized with updates you release to the CodePush server. This way, your app gets the benefits of an offline mobile experience, as well as the "web-like" agility of side-loading updates as soon as they are available. It's a win-win! In order to ensure that your end users always have a functioning version of your app, the CodePush plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to [roll back](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#rolling-back-updates) on the server. It's a win-win-win! *Note: Any product changes which touch native code (e.g. modifying your `AppDelegate.m`/`MainActivity.java` file, adding a new plugin) cannot be distributed via CodePush, and therefore, must be updated via the appropriate store(s).* ## Supported React Native platforms - iOS (7+) - Android (4.1+) on TLS 1.2 compatible devices - Windows (UWP) We try our best to maintain backwards compatibility of our plugin with previous versions of React Native, but due to the nature of the platform, and the existence of breaking changes between releases, it is possible that you need to use a specific version of the CodePush plugin in order to support the exact version of React Native you are using. The following table outlines which CodePush plugin versions officially support the respective React Native versions: | React Native version(s) | Supporting CodePush version(s) | |-------------------------|-------------------------------------------------------| | <0.14 | **Unsupported** | | v0.14 | v1.3 *(introduced Android support)* | | v0.15-v0.18 | v1.4-v1.6 *(introduced iOS asset support)* | | v0.19-v0.28 | v1.7-v1.17 *(introduced Android asset support)* | | v0.29-v0.30 | v1.13-v1.17 *(RN refactored native hosting code)* | | v0.31-v0.33 | v1.14.6-v1.17 *(RN refactored native hosting code)* | | v0.34-v0.35 | v1.15-v1.17 *(RN refactored native hosting code)* | | v0.36-v0.39 | v1.16-v1.17 *(RN refactored resume handler)* | | v0.40-v0.42 | v1.17 *(RN refactored iOS header files)* | | v0.43-v0.44 | v2.0+ *(RN refactored uimanager dependencies)* | | v0.45 | v3.0+ *(RN refactored instance manager code)* | | v0.46 | v4.0+ *(RN refactored js bundle loader code)* | | v0.46-v0.53 | v5.1+ *(RN removed unused registration of JS modules)*| | v0.54-v0.55 | v5.3+ *(Android Gradle Plugin 3.x integration)* | | v0.56-v0.58 | v5.4+ *(RN upgraded versions for Android tools)* | | v0.59 | v5.6+ *(RN refactored js bundle loader code)* | | v0.60-v0.61 | v6.0+ *(RN migrated to Autolinking)* | | v0.62-v0.64 | v6.2+ *(RN removed LiveReload)* | | v0.65-v0.70 | v7.0+ *(RN updated iPhone-target-version)* | | v0.71 | v8.0+ *(RN moved to react-native-gradle-plugin)* | *NOTE: `react-native-code-push` versions lower than **[v5.7.0](https://github.com/microsoft/react-native-code-push/releases/tag/v5.7.0)** will stop working in the near future. You can find more information in our [documentation](https://github.com/microsoft/code-push/blob/master/migration-notice.md).* We work hard to respond to new RN releases, but they do occasionally break us. We will update this chart with each RN release, so that users can check to see what our "official" support is. ### Supported Components When using the React Native assets system (i.e. using the `require("./foo.png")` syntax), the following list represents the set of core components (and props) that support having their referenced images and videos updated via CodePush: | Component | Prop(s) | |-------------------------------------------------|------------------------------------------| | `Image` | `source` | | `MapView.Marker`
*(Requires [react-native-maps](https://github.com/lelandrichardson/react-native-maps) `>=O.3.2`)* | `image` | | `ProgressViewIOS` | `progressImage`, `trackImage` | | `TabBarIOS.Item` | `icon`, `selectedIcon` | | `ToolbarAndroid`
*(React Native 0.21.0+)* | `actions[].icon`, `logo`, `overflowIcon` | | `Video` | `source` | The following list represents the set of components (and props) that don't currently support their assets being updated via CodePush, due to their dependency on static images and videos (i.e. using the `{ uri: "foo" }` syntax): | Component | Prop(s) | |-------------|----------------------------------------------------------------------| | `SliderIOS` | `maximumTrackImage`, `minimumTrackImage`, `thumbImage`, `trackImage` | | `Video` | `source` | As new core components are released, which support referencing assets, we'll update this list to ensure users know what exactly they can expect to update using CodePush. *Note: CodePush only works with Video components when using `require` in the source prop. For example:* ```javascript