@appcircle/react-native-code-push 0.0.2 → 0.0.3-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +63 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Appcircle React Native CodePush SDK
2
2
 
3
+ ## Table of Contents
4
+ 1. [Overview](#overview)
5
+ 2. [Features](#features)
6
+ 3. [Installation](#installation)
7
+ 4. [Platform Setup](#platform-setup)
8
+ - [iOS Setup](#ios-setup)
9
+ - [Android Setup](#android-setup)
10
+ 5. [Basic Usage](#basic-usage)
11
+ 6. [Releasing Updates](#releasing-updates)
12
+ - [Manual Release](#manual-release)
13
+ - [Automated Release](#automated-release)
14
+ 7. [Multi-Deployment Testing](#multi-deployment-testing)
15
+ 8. [Code Signing](#code-signing)
16
+
17
+
3
18
  ## Overview
4
19
 
5
20
  Appcircle React Native CodePush SDK enables you to deploy mobile app updates directly to your users' devices through Appcircle's CI/CD platform. This integration allows you to automate your deployment process and manage your app updates efficiently.
@@ -107,6 +122,54 @@ The SDK supports multiple deployment environments through Appcircle:
107
122
  - **Production**: For end-user updates
108
123
  - **Custom Deployments**: For A/B testing or specific user groups
109
124
 
125
+ ## Code Signing
126
+
127
+ The SDK supports code signing which ensures that every over‑the‑air (OTA) JavaScript bundle your React Native application receives originates from a trusted source and has not been altered in transit.
128
+
129
+ ### Configuration of Code Signing
130
+
131
+ Generate the key pairs. Use OpenSSL (or your preferred cryptographic toolkit) to create a 4096‑bit RSA key pair—or an ECC key with curve P‑256—store the private key securely. And then store the private key securely.
132
+
133
+ ```bash
134
+ # generate private RSA key
135
+ openssl genrsa -out private_codepush_signing_key.pem
136
+ # export public key
137
+ openssl rsa -pubout -in private_codepush_signing_key.pem -out public_codepush_signing_key.pem
138
+ ```
139
+
140
+ ### Setup and Installation
141
+ After generating the private and public keys locally, you must make a few configuration changes in your application. Begin by adding the generated public key to the project that you intend to sign, ensuring it is accessible at build time for signature verification.
142
+
143
+ #### For iOS, add the following to the `Info.plist`:
144
+ ```swift
145
+ <key>CodePushPublicKey</key>
146
+ <string>-----BEGIN PUBLIC KEY-----
147
+ Here is your public key
148
+ -----END PUBLIC KEY-----</string>
149
+ ```
150
+
151
+ #### For Android, add the following to the `Strings.xml`:
152
+ ```java
153
+ <resources>
154
+ <string name="app_name">my_app</string>
155
+ <string name="CodePushPublicKey">-----BEGIN PUBLIC KEY-----
156
+ Here is your public key
157
+ -----END PUBLIC KEY-----</string>
158
+ </resources>
159
+ ```
160
+
161
+ ### Signing CodePush Release
162
+ To create a signed CodePush release, you must first generate a build from your codebase with the public key already embedded. The resulting `.ipa` and `.apk` artifacts now contain the public key, enabling them to identify properly signed CodePush releases and safely apply OTA updates.
163
+
164
+ Once your binary is configured with the public key, you can publish a **signed** CodePush release through the **Appcircle CodePush CLI**:
165
+
166
+ ```bash
167
+ appcircle-code-push release-react <YOUR_APP_PROFILE_NAME> <platform> -d <DEPLOYMENT_CHANNEL_NAME> --privateKeyPath <YOUR_PRIVATE_KEY_PATH>
168
+ ```
169
+
170
+ Replace `<YOUR_APP_PROFILE_NAME>` with the CodePush Profile name shown in the Appcircle dashboard, update the `-d` flag as needed (e.g., *Staging*). The `--privateKeyPath` flag must reference the **same private key** you used to generate the public key embedded in the app; the CLI will sign the bundle before uploading it to Appcircle.
171
+
172
+ For more details, refer to the [Appcircle documentation.](https://docs.appcircle.io/code-push/code-push-code-signing)
110
173
 
111
174
  ## Contributing
112
175
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcircle/react-native-code-push",
3
- "version": "0.0.2",
3
+ "version": "0.0.3-alpha.1",
4
4
  "description": "React Native plugin for the CodePush service",
5
5
  "main": "CodePush.js",
6
6
  "typings": "typings/react-native-code-push.d.ts",