@appzung/react-native-code-push 11.0.0-rc9 → 11.0.0
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.
- package/README.md +11 -11
- package/android/app/src/main/java/com/appzung/codepush/react/CodePush.java +1 -0
- package/android/app/src/main/java/com/appzung/codepush/react/CodePushNativeModule.java +8 -2
- package/android/app/src/main/java/com/appzung/codepush/react/ExpoUtils.java +22 -0
- package/lib/commonjs/internals/version.js +1 -1
- package/lib/commonjs/internals/version.js.map +1 -1
- package/lib/module/internals/version.js +1 -1
- package/lib/module/internals/version.js.map +1 -1
- package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
- package/lib/typescript/commonjs/src/internals/version.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/version.d.ts +1 -1
- package/lib/typescript/module/src/internals/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/internals/version.ts +1 -1
package/README.md
CHANGED
|
@@ -103,7 +103,7 @@ See the [corresponding steps](./docs/migrating-to-v10.md).
|
|
|
103
103
|
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:
|
|
104
104
|
|
|
105
105
|
| React Native version(s) | Android | iOS | Old arch | New arch | Supporting CodePush version(s) |
|
|
106
|
-
|
|
106
|
+
| ----------------------- | --------------- | ---- | -------- | -------- | ------------------------------ |
|
|
107
107
|
| <0.59 | - | - | ✅ | ❌ | **Unsupported** |
|
|
108
108
|
| v0.59 | 4.1+ (TLS 1.2+) | 7 | ✅ | ❌ | v5.7.1 |
|
|
109
109
|
| v0.60-v0.61 | 4.1+ (TLS 1.2+) | 7 | ✅ | ❌ | v6.3.1 |
|
|
@@ -174,7 +174,7 @@ If you would like to display an update confirmation dialog (an "active install")
|
|
|
174
174
|
|
|
175
175
|
## Releasing updates
|
|
176
176
|
|
|
177
|
-
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. The recommended way to release them is
|
|
177
|
+
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. The recommended way to release them is running the `appzung releases deploy-react-native` command (or `appzung releases deploy-expo` if using Expo) in the AppZung CLI, which will bundle your JavaScript files, asset files, and release the update to the CodePush server.
|
|
178
178
|
|
|
179
179
|
### Locally
|
|
180
180
|
|
|
@@ -275,13 +275,13 @@ Note that by default, React Native logs are disabled on iOS in release builds, s
|
|
|
275
275
|
|
|
276
276
|
Now you'll be able to see CodePush logs in either debug or release mode, on both iOS or Android. If examining the logs don't provide an indication of the issue, please refer to the following common issues for additional resolution ideas:
|
|
277
277
|
|
|
278
|
-
| Issue / Symptom | Possible Solution
|
|
279
|
-
|
|
280
|
-
| Compilation Error | Clean your build folders and double-check that your version of React Native is [compatible](#compatibility-table) with the CodePush version you are using.
|
|
281
|
-
| 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.
|
|
278
|
+
| Issue / Symptom | Possible Solution |
|
|
279
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
280
|
+
| Compilation Error | Clean your build folders and double-check that your version of React Native is [compatible](#compatibility-table) with the CodePush version you are using. |
|
|
281
|
+
| 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. |
|
|
282
282
|
| Server responds with a `404` when calling `sync` or `checkForUpdate` | Double-check that the release channel public ID you added to your `Info.plist` (iOS), `strings.xml` or `app/build.gradle` (Android) or that you're passing to `sync`/`checkForUpdate`, is in fact correct. You can run `appzung release-channels list` to view the correct public ID for your app release channel. |
|
|
283
|
-
| 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 release channel that your app is configured to sync with.
|
|
284
|
-
| Update not being displayed after restart | If you're not using the withCodePush HOC or calling `sync` on app start (like within `componentDidMount` of your root component), then you need to explicitly call `notifyAppReady` on app start, otherwise, the plugin will think your update failed and roll it back.
|
|
285
|
-
| I've released an update for iOS but my Android app also shows an update and it breaks it | Be sure you have different release channels for each platform in order to receive updates correctly
|
|
286
|
-
| I've released new update but changes are not reflected | Be sure that you are running app in modes other than Debug. In Debug mode, React Native app always downloads JS bundle generated by packager, so JS bundle downloaded by CodePush does not apply.
|
|
287
|
-
| Android compilation fails after migrating to AppZung with error "Task :app:checkReleaseAarMetadata FAILED A problem was found with the configuration of task ':app:checkReleaseAarMetadata' (type 'CheckAarMetadataTask')". | In `android/settings.gradle` remove the lines about CodePush. Be sure to read the other [migration steps](./docs/migrating-to-v10.md) carefully to review if you missed any others.
|
|
283
|
+
| 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 release channel that your app is configured to sync with. |
|
|
284
|
+
| Update not being displayed after restart | If you're not using the withCodePush HOC or calling `sync` on app start (like within `componentDidMount` of your root component), then you need to explicitly call `notifyAppReady` on app start, otherwise, the plugin will think your update failed and roll it back. |
|
|
285
|
+
| I've released an update for iOS but my Android app also shows an update and it breaks it | Be sure you have different release channels for each platform in order to receive updates correctly |
|
|
286
|
+
| I've released new update but changes are not reflected | Be sure that you are running app in modes other than Debug. In Debug mode, React Native app always downloads JS bundle generated by packager, so JS bundle downloaded by CodePush does not apply. |
|
|
287
|
+
| Android compilation fails after migrating to AppZung with error "Task :app:checkReleaseAarMetadata FAILED A problem was found with the configuration of task ':app:checkReleaseAarMetadata' (type 'CheckAarMetadataTask')". | In `android/settings.gradle` remove the lines about CodePush. Be sure to read the other [migration steps](./docs/migrating-to-v10.md) carefully to review if you missed any others. |
|
|
@@ -203,6 +203,7 @@ public class CodePush implements ReactPackage {
|
|
|
203
203
|
|
|
204
204
|
public static String getJSBundleFile(String assetsBundleFileName) {
|
|
205
205
|
if (mCurrentInstance == null) {
|
|
206
|
+
CodePushUtils.log("A CodePush instance has not been created yet. Have you added it to your app's list of ReactPackages?");
|
|
206
207
|
throw new CodePushNotInitializedException("A CodePush instance has not been created yet. Have you added it to your app's list of ReactPackages?");
|
|
207
208
|
}
|
|
208
209
|
|
|
@@ -51,6 +51,7 @@ public class CodePushNativeModule extends BaseJavaModule {
|
|
|
51
51
|
private String mClientUniqueId = null;
|
|
52
52
|
private boolean mTelemetryEnabled = true;
|
|
53
53
|
private boolean mDataTransmissionEnabled = true;
|
|
54
|
+
private boolean mIsExpoApp = false;
|
|
54
55
|
private LifecycleEventListener mLifecycleEventListener = null;
|
|
55
56
|
private int mMinimumBackgroundDuration = 0;
|
|
56
57
|
|
|
@@ -71,6 +72,8 @@ public class CodePushNativeModule extends BaseJavaModule {
|
|
|
71
72
|
mTelemetryManager = codePushTelemetryManager;
|
|
72
73
|
mUpdateManager = codePushUpdateManager;
|
|
73
74
|
|
|
75
|
+
mIsExpoApp = ExpoUtils.detectExpoEnvironment(reactContext);
|
|
76
|
+
|
|
74
77
|
// Initialize module state while we have a reference to the current context.
|
|
75
78
|
mBinaryContentsHash = CodePushUpdateUtils.getHashForBinaryContents(reactContext, mCodePush.isDebugMode());
|
|
76
79
|
|
|
@@ -210,8 +213,11 @@ public class CodePushNativeModule extends BaseJavaModule {
|
|
|
210
213
|
|
|
211
214
|
String latestJSBundleFile = mCodePush.getJSBundleFileInternal(mCodePush.getAssetsBundleFileName());
|
|
212
215
|
|
|
213
|
-
//
|
|
214
|
-
|
|
216
|
+
// if expo and new arch this is unnecessary, see https://github.com/expo/expo/blob/8113ce44edaef0311e2daff3ab1a63b9731d2d6c/packages/expo-updates/android/src/main/java/expo/modules/updates/procedures/RelaunchProcedure.kt#L148
|
|
217
|
+
if (!mIsExpoApp) {
|
|
218
|
+
// #2) Update the locally stored JS bundle file path
|
|
219
|
+
setJSBundle(getReactHostDelegate((ReactHostImpl) reactHost), latestJSBundleFile);
|
|
220
|
+
}
|
|
215
221
|
|
|
216
222
|
// #3) Get the context creation method
|
|
217
223
|
try {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.appzung.codepush.react;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
|
|
5
|
+
public class ExpoUtils {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Detects if the app is running in an Expo environment by checking for
|
|
9
|
+
* the presence of Expo's ReactNativeHostWrapper class.
|
|
10
|
+
*
|
|
11
|
+
* @param reactContext The React application context
|
|
12
|
+
* @return true if Expo environment is detected, false otherwise
|
|
13
|
+
*/
|
|
14
|
+
public static boolean detectExpoEnvironment(ReactApplicationContext reactContext) {
|
|
15
|
+
try {
|
|
16
|
+
Class.forName("expo.modules.ReactNativeHostWrapper");
|
|
17
|
+
return true;
|
|
18
|
+
} catch (ClassNotFoundException e) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["version","exports"],"sourceRoot":"../../../src","sources":["internals/version.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,
|
|
1
|
+
{"version":3,"names":["version","exports"],"sourceRoot":"../../../src","sources":["internals/version.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["version"],"sourceRoot":"../../../src","sources":["internals/version.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"names":["version"],"sourceRoot":"../../../src","sources":["internals/version.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "11.0.0
|
|
1
|
+
export declare const version = "11.0.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../../src/internals/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../../src/internals/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,WAAW,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "11.0.0
|
|
1
|
+
export declare const version = "11.0.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../../src/internals/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../../src/internals/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appzung/react-native-code-push",
|
|
3
|
-
"version": "11.0.0
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "React Native plugin for the CodePush service",
|
|
5
5
|
"author": "Louis Lagrange <lagrange.louis@gmail.com> (https://github.com/Minishlink)",
|
|
6
6
|
"license": "MIT",
|
package/src/internals/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '11.0.0
|
|
2
|
+
export const version = '11.0.0';
|