diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index aab7c89ab..4d1796a5e 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -16,7 +16,7 @@ What actually happens? ### Reproducible Demo -* Download https://github.com/microsoft/react-native-code-push/archive/master.zip and unzip. From `Examples` folder run `node create-app.js appName react-native@0.71.19 react-native-code-push@9.0.1` command to generate plain CodePushified React Native app. Please see description on top of `create-app.js` file content if needed +* Download https://github.com/codemagic-ci-cd/react-native-code-push/archive/master.zip and unzip. From `Examples` folder run `node create-app.js appName react-native@0.71.19 react-native-code-push@9.0.1` command to generate plain CodePushified React Native app. Please see description on top of `create-app.js` file content if needed * If you can't reproduce the bug on it, provide us as much info as possible about your project ### Environment diff --git a/CodePush.podspec b/CodePush.podspec index 9b22e8237..4114cf935 100644 --- a/CodePush.podspec +++ b/CodePush.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.license = package['license'] s.homepage = package['homepage'] - s.source = { :git => 'https://github.com/CodePushNext/react-native-code-push.git', :tag => "v#{s.version}"} + s.source = { :git => 'https://github.com/codemagic-ci-cd/react-native-code-push.git', :tag => "v#{s.version}"} s.ios.deployment_target = '15.5' s.tvos.deployment_target = '15.5' s.preserve_paths = '*.js' diff --git a/LICENSE.md b/LICENSE.md index 09dae6fae..6ec97fd3e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,8 +1,6 @@ -Microsoft CodePush Plugin for React Native +Copyright (c) Microsoft Corporation. -Copyright (c) Microsoft Corporation - -All rights reserved. +Additional modifications copyright (c) Codemagic. MIT License @@ -10,4 +8,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index b3a05b272..9b2189a50 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # React Native Module for CodePush -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). +This plugin provides client-side integration for the [CodePush service](https://github.com/codemagic-ci-cd/react-native-code-push), allowing you to easily add a dynamic update experience to your React Native app(s). @@ -35,7 +35,7 @@ A React Native app is composed of JavaScript files and any accompanying [images] 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! +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 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)._ @@ -43,13 +43,12 @@ _Note: Any product changes which touch native code (e.g. modifying your `AppDele - iOS (7+) - Android (4.1+) on TLS 1.2 compatible devices -- Windows (UWP) - Not Tested. We recommend to use [microsoft/code-push-react-native](https://github.com/microsoft/react-native-code-push) +- Windows (UWP) - Not actively tested 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) | | ------------------------ | ---------------------------------------------------------------------------------------------------- | -| / - -appcenter codepush release-react -a /MyApp-iOS -appcenter codepush release-react -a /MyApp-Android -``` - -The `release-react` command enables such a simple workflow because it provides many sensible defaults (like generating a release bundle, assuming your app's entry file on iOS is either `index.ios.js` or `index.js`). However, all of these defaults can be customized to allow incremental flexibility as necessary, which makes it a good fit for most scenarios. - -```shell -# Release a mandatory update with a changelog -appcenter codepush release-react -a /MyApp-iOS -m --description "Modified the header color" - -# Release an update for an app that uses a non-standard entry file name, and also capture -# the sourcemap file generated by react-native bundle -appcenter codepush release-react -a /MyApp-iOS --entry-file MyApp.js --sourcemap-output ../maps/MyApp.map - -# Release a dev Android build to just 1/4 of your end users -appcenter codepush release-react -a /MyApp-Android --rollout 25 --development true - -# Release an update that targets users running any 1.1.* binary, as opposed to -# limiting the update to exact version name in the build.gradle file -appcenter codepush release-react -a /MyApp-Android --target-binary-version "~1.1.0" - -``` +Once your app is configured and distributed to your users, and you have made some JS or asset changes, it's time to release them. Use your CodePush-compatible server's CLI to bundle your JavaScript files, asset files, and release the update to the server. The CodePush client supports differential updates, so even though you are releasing your JS bundle and assets on every update, your end users will only actually download the files they need. The service handles this automatically so that you can focus on creating awesome apps and we can worry about optimizing end user downloads. -For more details about how the `release-react` command works, as well as the various parameters it exposes, refer to the [CLI docs](https://github.com/microsoft/code-push/tree/v3.0.1/cli#releasing-updates-react-native). Additionally, if you would prefer to handle running the `react-native bundle` command yourself, and therefore, want an even more flexible solution than `release-react`, refer to the [`release` command](https://github.com/microsoft/code-push/tree/v3.0.1/cli#releasing-updates-general) for more details. - -If you run into any issues, or have any questions/comments/feedback, you can ping us within the [#code-push](https://discord.gg/0ZcbPKXt5bWxFdFu) channel on Reactiflux, [e-mail us](mailto:codepushfeed@microsoft.com) and/or check out the [troubleshooting](#debugging--troubleshooting) details below. +If you run into any issues, or have any questions/comments/feedback, you can ping us within the [#code-push](https://discord.gg/0ZcbPKXt5bWxFdFu) channel on Reactiflux and/or check out the [troubleshooting](#debugging--troubleshooting) details below. _NOTE: CodePush updates should be tested in modes other than Debug mode. In Debug mode, React Native app always downloads JS bundle generated by packager, so JS bundle downloaded by CodePush does not apply._ @@ -321,19 +288,19 @@ _NOTE: CodePush updates should be tested in modes other than Debug mode. In Debu In our [getting started](#getting-started) docs, we illustrated how to configure the CodePush plugin using a specific deployment key. However, in order to effectively test your releases, it is critical that you leverage the `Staging` and `Production` deployments that are auto-generated when you first created your CodePush app (or any custom deployments you may have created). This way, you never release an update to your end users that you haven't been able to validate yourself. -_NOTE: Our client-side rollback feature can help unblock users after installing a release that resulted in a crash, and server-side rollbacks (i.e. `appcenter codepush rollback`) allow you to prevent additional users from installing a bad release once it's been identified. However, it's obviously better if you can prevent an erroneous update from being broadly released in the first place._ +_NOTE: Our client-side rollback feature can help unblock users after installing a release that resulted in a crash, and server-side rollbacks allow you to prevent additional users from installing a bad release once it's been identified. However, it's obviously better if you can prevent an erroneous update from being broadly released in the first place._ Taking advantage of the `Staging` and `Production` deployments allows you to achieve a workflow like the following (feel free to customize!): -1. Release a CodePush update to your `Staging` deployment using the `appcenter codepush release-react` command (or `appcenter codepush release` if you need more control) +1. Release a CodePush update to your `Staging` deployment 2. Run your staging/beta build of your app, sync the update from the server, and verify it works as expected -3. Promote the tested release from `Staging` to `Production` using the `appcenter codepush promote` command +3. Promote the tested release from `Staging` to `Production` 4. Run your production/release build of your app, sync the update from the server and verify it works as expected -_NOTE: If you want to take a more cautious approach, you can even choose to perform a "staged rollout" as part of #3, which allows you to mitigate additional potential risk with the update (like did your testing in #2 touch all possible devices/conditions?) by only making the production update available to a percentage of your users (for example `appcenter codepush promote -a / -s Staging -d Production -r 20`). Then, after waiting for a reasonable amount of time to see if any crash reports or customer feedback comes in, you can expand it to your entire audience by running `appcenter codepush patch -a / Production -r 100`._ +_NOTE: If you want to take a more cautious approach, you can even choose to perform a "staged rollout" as part of #3, which allows you to mitigate additional potential risk with the update (like did your testing in #2 touch all possible devices/conditions?) by only making the production update available to a percentage of your users. Then, after waiting for a reasonable amount of time to see if any crash reports or customer feedback comes in, you can expand it to your entire audience._ You'll notice that the above steps refer to a "staging build" and "production build" of your app. If your build process already generates distinct binaries per "environment", then you don't need to read any further, since swapping out CodePush deployment keys is just like handling environment-specific config for any other service your app uses (like Facebook). However, if you're looking for examples (**including demo projects**) on how to setup your build process to accommodate this, then refer to the following sections, depending on the platform(s) your app is targeting: @@ -363,11 +330,9 @@ _NOTE: If needed, you could also implement a hybrid solution that allowed your e Since we recommend using the `Staging` deployment for pre-release testing of your updates (as explained in the previous section), it doesn't neccessarily make sense to use it for performing A/B tests on your users, as opposed to allowing early-access (as explained in option #1 above). Therefore, we recommend making full use of custom app deployments, so that you can segment your users however makes sense for your needs. For example, you could create long-term or even one-off deployments, release a variant of your app to it, and then place certain users into it in order to see how they engage. ```javascript -// #1) Create your new deployment to hold releases of a specific app variant -appcenter codepush deployment add -a / test-variant-one +// #1) Create a new deployment to hold releases of a specific app variant via your CodePush server CLI // #2) Target any new releases at that custom deployment -appcenter codepush release-react -a / -d test-variant-one ``` _NOTE: The total user count that is reported in your deployment's "Install Metrics" will take into account users that have "switched" from one deployment to another. For example, if your `Production` deployment currently reports having 1 total user, but you dynamically switch that user to `Staging`, then the `Production` deployment would report 0 total users, while `Staging` would report 1 (the user that just switched). This behavior allows you to accurately track your release adoption, even in the event of using a runtime-based deployment redirection solution._ @@ -397,7 +362,7 @@ _Note: If you've developed a React Native app using CodePush, that is also open- ### Debugging / Troubleshooting -The `sync` method includes a lot of diagnostic logging out-of-the-box, so if you're encountering an issue when using it, the best thing to try first is examining the output logs of your app. This will tell you whether the app is configured correctly (like can the plugin find your deployment key?), if the app is able to reach the server, if an available update is being discovered, if the update is being successfully downloaded/installed, etc. We want to continue improving the logging to be as intuitive/comprehensive as possible, so please [let us know](mailto:codepushfeed@microsoft.com) if you find it to be confusing or missing anything. +The `sync` method includes a lot of diagnostic logging out-of-the-box, so if you're encountering an issue when using it, the best thing to try first is examining the output logs of your app. This will tell you whether the app is configured correctly (like can the plugin find your deployment key?), if the app is able to reach the server, if an available update is being discovered, if the update is being successfully downloaded/installed, etc. We want to continue improving the logging to be as intuitive/comprehensive as possible, so please [let us know](https://github.com/codemagic-ci-cd/react-native-code-push/issues) if you find it to be confusing or missing anything. The simplest way to view these logs is to add the flag `--debug` for each command. This will output a log stream that is filtered to just CodePush messages. This makes it easy to identify issues, without needing to use a platform-specific tool, or wade through a potentially high volume of logs. @@ -421,7 +386,7 @@ Now you'll be able to see CodePush logs in either debug or release mode, on both | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Compilation Error | Double-check that your version of React Native is [compatible](#supported-react-native-platforms) with the CodePush version you are using. | | Network timeout / hang when calling `sync` or `checkForUpdate` in the iOS Simulator | Try resetting the simulator by selecting the `Simulator -> Reset Content and Settings..` menu item, and then re-running your app. | -| Server responds with a `404` when calling `sync` or `checkForUpdate` | Double-check that the deployment key you added to your `Info.plist` (iOS), `build.gradle` (Android) or that you're passing to `sync`/`checkForUpdate`, is in fact correct. You can run `appcenter codepush deployment list / --displayKeys` to view the correct keys for your app deployments. | +| Server responds with a `404` when calling `sync` or `checkForUpdate` | Double-check that the deployment key you added to your `Info.plist` (iOS), `build.gradle` (Android) or that you're passing to `sync`/`checkForUpdate`, is in fact correct. You can verify the correct keys for your app deployments using your CodePush CLI. | | Update not being discovered | Double-check that the version of your running app (like `1.0.0`) matches the version you specified when releasing the update to CodePush. Additionally, make sure that you are releasing to the same deployment that your app is configured to sync with. | | Update not being displayed after restart | If you're not calling `sync` on app start (like within `componentDidMount` of your root component), then you need to explicitly call `notifyApplicationReady` on app start, otherwise, the plugin will think your update failed and roll it back. | | I've released an update for iOS but my Android app also shows an update and it breaks it | Be sure you have different deployment keys for each platform in order to receive updates correctly | @@ -432,7 +397,6 @@ Now you'll be able to see CodePush logs in either debug or release mode, on both In addition to being able to use the CodePush CLI to "manually" release updates, we believe that it's important to create a repeatable and sustainable solution for contiously delivering updates to your app. That way, it's simple enough for you and/or your team to create and maintain the rhythm of performing agile deployments. In order to assist with setting up a CodePush-based CD pipeline, refer to the following integrations with various CI servers: -- [Visual Studio Team Services](https://marketplace.visualstudio.com/items?itemName=ms-vsclient.code-push) - _NOTE: VSTS also has extensions for publishing to [HockeyApp](https://marketplace.visualstudio.com/items?itemName=ms.hockeyapp) and the [Google Play](https://github.com/microsoft/google-play-vsts-extension) store, so it provides a pretty great mobile CD solution in general._ - [Travis CI](https://github.com/mondora/code-push-travis-cli) Additionally, if you'd like more details of what a complete mobile CI/CD workflow can look like, which includes CodePush, check out this [excellent article](https://medium.com/zeemee-engineering/zeemee-engineering-and-the-quest-for-the-holy-mobile-dev-grail-1310be4953d1) by the [ZeeMee engineering team](https://www.zeemee.com/). @@ -441,6 +405,3 @@ Additionally, if you'd like more details of what a complete mobile CI/CD workflo This module ships its `*.d.ts` file as part of its NPM package, which allows you to simply `import` it, and receive intellisense in supporting editors (like Visual Studio Code), as well as compile-time type checking if you're using TypeScript. For the most part, this behavior should just work out of the box, however, if you've specified `es6` as the value for either the `target` or `module` [compiler option](http://www.typescriptlang.org/docs/handbook/compiler-options.html) in your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file, then just make sure that you also set the `moduleResolution` option to `node`. This ensures that the TypeScript compiler will look within the `node_modules` for the type definitions of imported modules. Otherwise, you'll get an error like the following when trying to import the `react-native-code-push` module: `error TS2307: Cannot find module 'react-native-code-push'`. ---- - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md index 46bf9ec0c..ec8ca9287 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,41 +1,9 @@ - +# Security Policy -## Security +## Reporting a Vulnerability -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). +If you discover a security vulnerability in this project, please report it through GitHub's private vulnerability reporting: -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. +**https://github.com/codemagic-ci-cd/react-native-code-push/security/advisories/new** -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - -* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) -* Full paths of source file(s) related to the manifestation of the issue -* The location of the affected source code (tag/branch/commit or direct URL) -* Any special configuration required to reproduce the issue -* Step-by-step instructions to reproduce the issue -* Proof-of-concept or exploit code (if possible) -* Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). - - \ No newline at end of file +Please do not open a public issue for security vulnerabilities. diff --git a/code-push-plugin-testing-framework/package.json b/code-push-plugin-testing-framework/package.json index eafc11471..4f6bf7037 100644 --- a/code-push-plugin-testing-framework/package.json +++ b/code-push-plugin-testing-framework/package.json @@ -8,13 +8,13 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/microsoft/code-push.git" + "url": "git+https://github.com/codemagic-ci-cd/react-native-code-push.git" }, "author": { - "name": "Microsoft Corporation" + "name": "Codemagic" }, "license": "MIT", - "homepage": "https://microsoft.github.io/code-push", + "homepage": "https://github.com/codemagic-ci-cd/react-native-code-push", "dependencies": { "@types/uuid": "^8.3.1", "base-64": "^1.0.0", @@ -27,7 +27,7 @@ "uuid": "^8.3.2" }, "bugs": { - "url": "https://github.com/microsoft/code-push/issues" + "url": "https://github.com/codemagic-ci-cd/react-native-code-push/issues" }, "readme": "ERROR: No README data found!", "_id": "code-push-plugin-testing-framework@0.0.1", diff --git a/docs/api-android.md b/docs/api-android.md index 092bfbb4a..972c30f97 100644 --- a/docs/api-android.md +++ b/docs/api-android.md @@ -10,7 +10,7 @@ Since `autolinking` uses `react-native.config.js` to link plugins, constructors ``` - **Server Url** - used for specifying CodePush Server Url. - The Default value: "https://codepush.appcenter.ms/" is overridden by adding your path to `strings.xml` with name `CodePushServerUrl`. CodePush automatically gets this property and will use this path to send requests. For example: + The default server URL is configurable and can be overridden by adding your path to `strings.xml` with name `CodePushServerUrl`. CodePush automatically gets this property and will use this path to send requests. For example: ```xml https://yourcodepush.server.com ``` @@ -35,7 +35,7 @@ Constructs the CodePush client runtime and represents the `ReactPackage` instanc - **CodePush(String deploymentKey, Context context, boolean isDebugMode, Integer publicKeyResourceDescriptor)** - Equivalent to the previous constructor, but allows you to specify the public key resource descriptor needed to read public key content. Please refer to [Code Signing](setup-android.md#code-signing-setup) section for more details about the Code Signing Feature. -- **CodePush(String deploymentKey, Context context, boolean isDebugMode, String serverUrl)** Constructor allows you to specify CodePush Server Url. The Default value: `"https://codepush.appcenter.ms/"` is overridden by value specified in `serverUrl`. +- **CodePush(String deploymentKey, Context context, boolean isDebugMode, String serverUrl)** Constructor allows you to specify CodePush Server Url. The default server URL is configurable and is overridden by value specified in `serverUrl`. ##### Public Methods diff --git a/docs/api-js.md b/docs/api-js.md index 0f946a102..5be67c03b 100644 --- a/docs/api-js.md +++ b/docs/api-js.md @@ -128,7 +128,7 @@ The `codePush` decorator accepts an "options" object that allows you to customiz * __minimumBackgroundDuration__ *(Number)* - Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying the update immediately after a resume or unless the app suspension is long enough to not matter, regardless how long it was in the background. -* __updateDialog__ *(UpdateDialogOptions)* - An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to `null`, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings. Before enabling this option within an App Store-distributed app, please refer to [this note](https://github.com/microsoft/react-native-code-push#app-store). +* __updateDialog__ *(UpdateDialogOptions)* - An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to `null`, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings. Before enabling this option within an App Store-distributed app, please refer to [this note](https://github.com/codemagic-ci-cd/react-native-code-push#app-store). The following list represents the available options and their defaults: diff --git a/docs/multi-deployment-testing-android.md b/docs/multi-deployment-testing-android.md index 8d61bd97e..b07721ed0 100644 --- a/docs/multi-deployment-testing-android.md +++ b/docs/multi-deployment-testing-android.md @@ -2,11 +2,11 @@ > NOTE > -> Complete demo configured with "multi-deployment testing" feature is [here](https://github.com/microsoft/react-native-code-push/files/1314118/rncp1004.zip). +> Complete demo configured with "multi-deployment testing" feature is [here](https://github.com/codemagic-ci-cd/react-native-code-push/files/1314118/rncp1004.zip). The [Android Gradle plugin](https://google.github.io/android-gradle-dsl/current/index.html) allows you to define custom config settings for each "build type" (like debug, release). This mechanism allows you to easily configure your debug builds to use your CodePush staging deployment key and your release builds to use your CodePush production deployment key. -*NOTE: As a reminder, you can retrieve these keys by running `appcenter codepush deployment list -a / -k` from your terminal.* +*NOTE: As a reminder, you can retrieve these keys using your CodePush CLI.* To set this up, perform the following steps: diff --git a/docs/multi-deployment-testing-ios.md b/docs/multi-deployment-testing-ios.md index e9e57185d..41ffe8ddc 100644 --- a/docs/multi-deployment-testing-ios.md +++ b/docs/multi-deployment-testing-ios.md @@ -3,8 +3,8 @@ > NOTE > > Complete demos configured with "multi-deployment testing" feature are [here]: -> * **without using cocoa pods**: [link](https://github.com/microsoft/react-native-code-push/files/1259957/rncp976.copy.zip) -> * **using cocoa pods**: [link](https://github.com/microsoft/react-native-code-push/files/1172217/rncp893.copy.zip) +> * **without using cocoa pods**: [link](https://github.com/codemagic-ci-cd/react-native-code-push/files/1259957/rncp976.copy.zip) +> * **using cocoa pods**: [link](https://github.com/codemagic-ci-cd/react-native-code-push/files/1172217/rncp893.copy.zip) Xcode allows you to define custom build settings for each "configuration" (like debug, release), which can then be referenced as the value of keys within the `Info.plist` file (like the `CodePushDeploymentKey` setting). This mechanism allows you to easily configure your builds to produce binaries, which are configured to synchronize with different CodePush deployments. @@ -44,7 +44,7 @@ To set this up, perform the following steps: ![Setting Keys](https://cloud.githubusercontent.com/assets/8598682/16821919/fc1eac4a-490d-11e6-9b11-128129c24b80.png) - *NOTE: As a reminder, you can retrieve these keys by running `appcenter codepush deployment list -a / -k` from your terminal.* + *NOTE: As a reminder, you can retrieve these keys using your CodePush CLI.* 9. Open your project's `Info.plist` file and change the value of your `CodePushDeploymentKey` entry to `$(CODEPUSH_KEY)` @@ -54,6 +54,6 @@ And that's it! Now when you run or build your app, your staging builds will auto *NOTE: CocoaPods users may need to run `pod install` before building with their new release configuration.* -*Note: If you encounter the error message `ld: library not found for ...`, please consult [this issue](https://github.com/microsoft/react-native-code-push/issues/426) for a possible solution.* +*Note: If you encounter the error message `ld: library not found for ...`, please consult [this issue](https://github.com/codemagic-ci-cd/react-native-code-push/issues/426) for a possible solution.* Additionally, if you want to give them seperate names and/or icons, you can modify the `Product Bundle Identifier`, `Product Name` and `Asset Catalog App Icon Set Name` build settings, which will allow your staging builds to be distinguishable from release builds when installed on the same device. diff --git a/docs/setup-android.md b/docs/setup-android.md index cae722447..8eb98e80d 100644 --- a/docs/setup-android.md +++ b/docs/setup-android.md @@ -74,7 +74,7 @@ In order to integrate CodePush into your Android project, please perform the fol 3. Add the Deployment key to `strings.xml`: - To let the CodePush runtime know which deployment it should query for updates, open your app's `strings.xml` file and add a new string named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure this app against (like the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value by running `appcenter codepush deployment list -a / -k` in the CodePush CLI (the `-k` flag is necessary since keys aren't displayed by default) and copying the value of the `Key` column which corresponds to the deployment you want to use (see below). Note that using the deployment's name (like Staging) will not work. The "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app. + To let the CodePush runtime know which deployment it should query for updates, open your app's `strings.xml` file and add a new string named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure this app against (like the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value using your CodePush CLI (deployment keys aren't displayed by default) and copying the value of the `Key` column which corresponds to the deployment you want to use (see below). Note that using the deployment's name (like Staging) will not work. The "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app. ![Deployment list](https://cloud.githubusercontent.com/assets/116461/11601733/13011d5e-9a8a-11e5-9ce2-b100498ffb34.png) @@ -98,7 +98,7 @@ In order to effectively make use of the `Staging` and `Production` deployments t ### Code Signing setup -Starting with CLI version **2.1.0** you can self sign bundles during release and verify its signature before installation of update. For more info about Code Signing please refer to [relevant code-push documentation section](https://github.com/microsoft/code-push/tree/v3.0.1/cli#code-signing). In order to use Public Key for Code Signing you need to do following steps: +Starting with CLI version **2.1.0** you can self sign bundles during release and verify its signature before installation of update. For more info about Code Signing please refer to the relevant code-push documentation. In order to use Public Key for Code Signing you need to do following steps: Add `CodePushPublicKey` string item to `/path_to_your_app/android/app/src/main/res/values/strings.xml`. It may looks like this: @@ -118,6 +118,6 @@ zwIDAQAB ``` ### Expo Integration -1. A pure expo react-native is not supported yet. We are planning to look into this after a while. See https://github.com/CodePushNext/react-native-code-push/issues/5 +1. A pure expo react-native is not supported yet. We are planning to look into this after a while. See https://github.com/codemagic-ci-cd/react-native-code-push/issues/5 2. A bare react-native app with expo sdk is supported, but you have to initialize rn app without `ReactNativeHostWrapper` of expo. It seems `ReactNativeHostWrapper` overrides `getJsBundleFile` internally, which prevents `CodePush` from being configured correctly. https://github.com/expo/expo/issues/25865 diff --git a/docs/setup-ios.md b/docs/setup-ios.md index 3918f9c1e..b5edc9cb5 100644 --- a/docs/setup-ios.md +++ b/docs/setup-ios.md @@ -73,7 +73,7 @@ Once you've acquired the CodePush plugin, you need to integrate it into the Xcod 4. Add the Deployment key to `Info.plist`: - To let the CodePush runtime know which deployment it should query for updates against, open your app's `Info.plist` file and add a new entry named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure this app against (like the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value by running `appcenter codepush deployment list -a / -k` in the AppCenter CLI (the `-k` flag is necessary since keys aren't displayed by default) and copying the value of the `Key` column which corresponds to the deployment you want to use (see below). Note that using the deployment's name (like Staging) will not work. That "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app. + To let the CodePush runtime know which deployment it should query for updates against, open your app's `Info.plist` file and add a new entry named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure this app against (like the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value using your CodePush CLI (deployment keys aren't displayed by default) and copying the value of the `Key` column which corresponds to the deployment you want to use (see below). Note that using the deployment's name (like Staging) will not work. That "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app. ![Deployment list](https://cloud.githubusercontent.com/assets/116461/11601733/13011d5e-9a8a-11e5-9ce2-b100498ffb34.png) @@ -84,13 +84,7 @@ Once you've acquired the CodePush plugin, you need to integrate it into the Xcod ### HTTP exception domains configuration (iOS) -CodePush plugin makes HTTPS requests to the following domains: - -- codepush.appcenter.ms -- codepush.blob.core.windows.net -- codepushupdates.azureedge.net - -If you want to change the default HTTP security configuration for any of these domains, you have to define the [`NSAppTransportSecurity` (ATS)][ats] configuration inside your __Info.plist__ file: +CodePush plugin makes HTTPS requests to your CodePush server. If you want to change the default HTTP security configuration for your server domain, you have to define the [`NSAppTransportSecurity` (ATS)][ats] configuration inside your __Info.plist__ file: ```xml @@ -101,7 +95,7 @@ If you want to change the default HTTP security configuration for any of these d NSExceptionDomains - codepush.appcenter.ms + your.codepush.server @@ -117,7 +111,7 @@ Before doing anything, please [read the docs][ats] first. ### Code Signing setup -Starting with CLI version **2.1.0** you can self sign bundles during release and verify its signature before installation of update. For more info about Code Signing please refer to [relevant code-push documentation section](https://github.com/microsoft/code-push/tree/v3.0.1/cli#code-signing). +Starting with CLI version **2.1.0** you can self sign bundles during release and verify its signature before installation of update. For more info about Code Signing please refer to the relevant code-push documentation. In order to configure Public Key for bundle verification you need to add record in `Info.plist` with name `CodePushPublicKey` and string value of public key content. Example: diff --git a/docs/setup-windows.md b/docs/setup-windows.md index bba0a2dca..102ad62e9 100644 --- a/docs/setup-windows.md +++ b/docs/setup-windows.md @@ -93,7 +93,7 @@ class MainReactNativeHost : ReactNativeHost // 3. Update the JavaScriptBundleFile property to initalize the CodePush runtime, // specifying the right deployment key, then use it to return the bundle URL from // CodePush instead of statically from the binary. If you don't already have your - // deployment key, you can run "appcenter codepush deployment list -a / -k" to retrieve it. + // deployment key, you can retrieve it using your CodePush CLI. protected override string JavaScriptBundleFile { get diff --git a/package.json b/package.json index 39cf5e3e6..766ec86c4 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "React Native plugin for the CodePush service", "main": "CodePush.js", "typings": "typings/react-native-code-push.d.ts", - "homepage": "https://microsoft.github.io/code-push", + "homepage": "https://github.com/codemagic-ci-cd/react-native-code-push", "keywords": [ "react-native", "code", @@ -38,7 +38,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/CodePushNext/react-native-code-push" + "url": "https://github.com/codemagic-ci-cd/react-native-code-push" }, "dependencies": { "code-push": "4.2.3", diff --git a/scripts/generateBundledResourcesHash.js b/scripts/generateBundledResourcesHash.js index 01ab70ca5..d1067ecec 100644 --- a/scripts/generateBundledResourcesHash.js +++ b/scripts/generateBundledResourcesHash.js @@ -83,7 +83,7 @@ function addJsBundleAndMetaToManifest() { // "CodePushHash.json" file name breaks flow type checking. // To fix the issue we need to delete "CodePushHash.json" file and // use "CodePushHash" file name instead to store the hash value. - // Relates to https://github.com/microsoft/react-native-code-push/issues/577 + // Relates to https://github.com/codemagic-ci-cd/react-native-code-push/issues/577 var oldSavedResourcesManifestPath = assetsDir + "/" + CODE_PUSH_HASH_OLD_FILE_NAME; if (fs.existsSync(oldSavedResourcesManifestPath)) { fs.unlinkSync(oldSavedResourcesManifestPath); diff --git a/scripts/postlink/android/postlink.js b/scripts/postlink/android/postlink.js index 1edc99ade..a3eb32576 100644 --- a/scripts/postlink/android/postlink.js +++ b/scripts/postlink/android/postlink.js @@ -37,14 +37,14 @@ module.exports = () => { } else { return Promise.reject(`Couldn't find Android application entry point. You might need to update it manually. \ Please refer to plugin configuration section for Android at \ - https://github.com/microsoft/react-native-code-push/blob/master/docs/setup-android.md#plugin-configuration-for-react-native-lower-than-060-android for more details`); + https://github.com/codemagic-ci-cd/react-native-code-push/blob/master/docs/setup-android.md#plugin-configuration-for-react-native-lower-than-060-android for more details`); } } if (!fs.existsSync(buildGradlePath)) { return Promise.reject(`Couldn't find build.gradle file. You might need to update it manually. \ Please refer to plugin installation section for Android at \ - https://github.com/microsoft/react-native-code-push/blob/master/docs/setup-android.md#plugin-installation-android---manual`); + https://github.com/codemagic-ci-cd/react-native-code-push/blob/master/docs/setup-android.md#plugin-installation-android---manual`); } // 2. Add the codepush.gradle build task definitions diff --git a/scripts/postlink/ios/postlink.js b/scripts/postlink/ios/postlink.js index 948dbf419..3b751854c 100644 --- a/scripts/postlink/ios/postlink.js +++ b/scripts/postlink/ios/postlink.js @@ -16,7 +16,7 @@ module.exports = () => { if (!appDelegatePath) { return Promise.reject(`Couldn't find AppDelegate. You might need to update it manually \ Please refer to plugin configuration section for iOS at \ - https://github.com/microsoft/react-native-code-push#plugin-configuration-ios`); + https://github.com/codemagic-ci-cd/react-native-code-push#plugin-configuration-ios`); } var appDelegateContents = fs.readFileSync(appDelegatePath, "utf8"); @@ -84,7 +84,7 @@ module.exports = () => { if (!plistPath) { return Promise.reject(`Couldn't find .plist file. You might need to update it manually \ Please refer to plugin configuration section for iOS at \ - https://github.com/microsoft/react-native-code-push#plugin-configuration-ios`); + https://github.com/codemagic-ci-cd/react-native-code-push#plugin-configuration-ios`); } var plistContents = fs.readFileSync(plistPath, "utf8"); diff --git a/scripts/postunlink/android/postunlink.js b/scripts/postunlink/android/postunlink.js index f88ac0f28..f6206c8dc 100644 --- a/scripts/postunlink/android/postunlink.js +++ b/scripts/postunlink/android/postunlink.js @@ -31,7 +31,7 @@ module.exports = () => { } else { console.log(`Couldn't find Android application entry point. You might need to update it manually. \ Please refer to plugin configuration section for Android at \ - https://github.com/microsoft/react-native-code-push/blob/master/docs/setup-android.md#plugin-configuration-for-react-native-lower-than-060-android for more details`); + https://github.com/codemagic-ci-cd/react-native-code-push/blob/master/docs/setup-android.md#plugin-configuration-for-react-native-lower-than-060-android for more details`); } } @@ -41,7 +41,7 @@ module.exports = () => { if (!fs.existsSync(buildGradlePath)) { console.log(`Couldn't find build.gradle file. You might need to update it manually. \ Please refer to plugin installation section for Android at \ - https://github.com/microsoft/react-native-code-push/blob/master/docs/setup-android.md#plugin-installation-android---manual`); + https://github.com/codemagic-ci-cd/react-native-code-push/blob/master/docs/setup-android.md#plugin-installation-android---manual`); } else { var buildGradleContents = fs.readFileSync(buildGradlePath, "utf8"); var codePushGradleLink = linkTools.codePushGradleLink; diff --git a/scripts/postunlink/ios/postunlink.js b/scripts/postunlink/ios/postunlink.js index 8631b72ea..923cb98c8 100644 --- a/scripts/postunlink/ios/postunlink.js +++ b/scripts/postunlink/ios/postunlink.js @@ -14,7 +14,7 @@ module.exports = () => { if (!appDelegatePath) { console.log(`Couldn't find AppDelegate. You might need to update it manually \ Please refer to plugin configuration section for iOS at \ - https://github.com/microsoft/react-native-code-push#plugin-configuration-ios`); + https://github.com/codemagic-ci-cd/react-native-code-push#plugin-configuration-ios`); } else { var appDelegateContents = fs.readFileSync(appDelegatePath, "utf8"); @@ -68,7 +68,7 @@ module.exports = () => { if (!plistPath) { return Promise.reject(`Couldn't find .plist file. You might need to update it manually \ Please refer to plugin configuration section for iOS at \ - https://github.com/microsoft/react-native-code-push#plugin-configuration-ios`); + https://github.com/codemagic-ci-cd/react-native-code-push#plugin-configuration-ios`); } var plistContents = fs.readFileSync(plistPath, "utf8"); diff --git a/scripts/tools/linkToolsIos.js b/scripts/tools/linkToolsIos.js index fa3003c05..61cbefb0a 100644 --- a/scripts/tools/linkToolsIos.js +++ b/scripts/tools/linkToolsIos.js @@ -22,7 +22,7 @@ exports.getJsCodeLocationPatch = function(defaultJsCodeLocationAssignmentStateme #endif`; } -// Fix for https://github.com/microsoft/react-native-code-push/issues/477 +// Fix for https://github.com/codemagic-ci-cd/react-native-code-push/issues/477 // Typical location of AppDelegate.m for newer RN versions: $PROJECT_ROOT/ios//AppDelegate.m // Let's try to find that path by filtering the whole array for any path containing // If we can't find it there, play dumb and pray it is the first path we find. @@ -71,7 +71,7 @@ exports.getPlistPath = function() { } //also remove surrounding quotes from plistPathValue to get correct path resolved - //(see https://github.com/microsoft/react-native-code-push/issues/534#issuecomment-302069326 for details) + //(see https://github.com/codemagic-ci-cd/react-native-code-push/issues/534#issuecomment-302069326 for details) return path.resolve(path.dirname(xcodeProjectPath), '..', plistPathValue.replace(/^"(.*)"$/, '$1')); }