You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-android.md
+21-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,23 @@
1
1
### Java API Reference (Android)
2
2
3
+
### API for React Native 0.60 version and above
4
+
5
+
Since `autolinking` uses `react-native.config.js` to link plugins, constructors are specified in that file. But you can override custom variables to manage the CodePush plugin by placing these values in string resources.
6
+
7
+
*__Public Key__ - used for bundle verification in the Code Signing Feature. Please refer to [Code Signing](setup-android.md#code-signing-setup) section for more details about the Code Signing Feature.
8
+
To set the public key, you should add the content of the public key to `strings.xml` with name `CodePushPublicKey`. CodePush automatically gets this property and enables the Code Signing feature. For example:
* __Server Url__ - used for specifying CodePush Server Url.
14
+
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 Java API is made available by importing the `com.microsoft.codepush.react.CodePush` class into your `MainActivity.java` file, and consists of a single public class named `CodePush`.
4
22
5
23
#### CodePush
@@ -16,9 +34,9 @@ Constructs the CodePush client runtime and represents the `ReactPackage` instanc
16
34
17
35
2. The local cache that the React Native runtime maintains in debug mode is deleted whenever a CodePush update is installed. This ensures that when the app is restarted after an update is applied, you will see the expected changes. As soon as [this PR](https://github.com/facebook/react-native/pull/4738) is merged, we won't need to do this anymore.
18
36
19
-
-__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) section for more details about Code Signing Feature.
37
+
- __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.
20
38
21
-
-__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 specfied in `serverUrl`.
39
+
- __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`.
22
40
23
41
##### Builder
24
42
@@ -46,7 +64,7 @@ As an alternative to constructors *you can also use `CodePushBuilder`* to setup
46
64
47
65
*__public CodePushBuilder setServerUrl(String serverUrl)__ - allows you to specify CodePush Server Url. Default value: `"https://codepush.appcenter.ms/"`.
48
66
49
-
*__public CodePushBuilder setPublicKeyResourceDescriptor(int publicKeyResourceDescriptor)__ - allows you to specify Public Key resource descriptor which will be used for reading Public Key content for `strings.xml` file. Please refer to [Code Signing](#code-signing) section for more detailed information about purpose of this parameter.
67
+
*__public CodePushBuilder setPublicKeyResourceDescriptor(int publicKeyResourceDescriptor)__ - allows you to specify Public Key resource descriptor which will be used for reading Public Key content for `strings.xml` file. Please refer to [Code Signing](setup-android.md#code-signing-setup) section for more detailed information about purpose of this parameter.
Copy file name to clipboardExpand all lines: docs/multi-deployment-testing-android.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,13 @@ To set this up, perform the following steps:
23
23
debug {
24
24
...
25
25
// Note: CodePush updates should not be tested in Debug mode as they are overriden by the RN packager. However, because CodePush checks for updates in all modes, we must supply a key.
In order to integrate CodePush into your Android project, please perform the following steps:
19
19
@@ -52,7 +52,7 @@ In order to integrate CodePush into your Android project, please perform the fol
52
52
53
53
3. Add the Deployment key to `strings.xml`:
54
54
55
-
To let the CodePush runtime know which deployment it should query for updates against, open your app's `strings.xml` file and add a new string named `reactNativeCodePush_androidDeploymentKey`, 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 `code-push deployment ls <appName> -k` in the CodePush CLI (the `-k` flag is necessary since keys aren't displayed by default) and copying the value of the `Deployment 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.
55
+
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 `code-push deployment ls <appName> -k` in the CodePush CLI (the `-k` flag is necessary since keys aren't displayed by default) and copying the value of the `Deployment 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.
*Note: You can also set your deployment key in JS code using [Code-Push options](./api-js.md#CodePushOptions)*
70
+
*Note: If you need to dynamically use a different deployment, you can also override your deployment key in JS code using [Code-Push options](./api-js.md#CodePushOptions)*
71
71
72
72
### Plugin Installation for React Native lower than 0.60 (Android)
73
73
@@ -414,11 +414,11 @@ public class MainApplication extends NavigationApplication {
414
414
}
415
415
```
416
416
417
-
####CodeSigning setup
417
+
### CodeSigning setup
418
418
419
419
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 CodeSigning please refer to [relevant code-push documentation section](https://github.com/Microsoft/code-push/tree/master/cli#code-signing). In order to use Public Key for Code Signing you need to do following steps:
420
420
421
-
1.Add `CodePushPublicKey` string item to `/path_to_your_app/android/app/src/main/res/values/strings.xml`.It may looks like this:
421
+
Add `CodePushPublicKey` string item to `/path_to_your_app/android/app/src/main/res/values/strings.xml`.It may looks like this:
422
422
423
423
```xml
424
424
<resources>
@@ -435,9 +435,9 @@ zwIDAQAB
435
435
</resources>
436
436
```
437
437
438
-
2.Configure`CodePush` instance to use this parameter
438
+
#### ForReactNative<= v0.60 you should configure the `CodePush` instance to use this parameter using one of the following approaches
Copy file name to clipboardExpand all lines: docs/setup-ios.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -50,8 +50,8 @@ Once you've acquired the CodePush plugin, you need to integrate it into the Xcod
50
50
51
51
In order to effectively make use of the `Staging` and `Production` deployments that were created along with your CodePush app, refer to the [multi-deployment testing](../README.md#multi-deployment-testing) docs below before actually moving your app's usage of CodePush into production.
52
52
53
-
*Note: You can also set your deployment key in JS code using [Code-Push options](./api-js.md#CodePushOptions)*
54
-
53
+
*Note: If you need to dynamically use a different deployment, you can also override your deployment key in JS code using [Code-Push options](./api-js.md#CodePushOptions)*
54
+
55
55
### Plugin Installation for React Native lower than 0.60 (iOS)
56
56
57
57
In order to accommodate as many developer preferences as possible, the CodePush plugin supports iOS installation via three mechanisms:
Copy file name to clipboardExpand all lines: package.json
+1-1
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@
42
42
},
43
43
"rnpm": {
44
44
"android": {
45
-
"packageInstance": "new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG)"
45
+
"packageInstance": "new CodePush(getResources().getString(R.string.CodePushDeploymentKey), getApplicationContext(), BuildConfig.DEBUG)"
0 commit comments