@appzung/react-native-code-push 11.0.0-rc8 → 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 CHANGED
@@ -109,8 +109,9 @@ We try our best to maintain backwards compatibility of our plugin with previous
109
109
  | v0.60-v0.61 | 4.1+ (TLS 1.2+) | 7 | ✅ | ❌ | v6.3.1 |
110
110
  | v0.62-v0.64 | 4.1+ (TLS 1.2+) | 7 | ✅ | ❌ | v6.4.2 |
111
111
  | v0.65-v0.70 | 4.1+ (TLS 1.2+) | 9 | ✅ | ❌ | v7.1.1 |
112
- | v0.71+ | 4.1+ (TLS 1.2+) | 9 | ✅ | ❌ | v8.3.2 |
113
- | v0.71+ | 4.1+ (TLS 1.2+) | 15.5 | ✅ | ❌ | v9.0.2 or v10+ |
112
+ | v0.71-v0.79 | 4.1+ (TLS 1.2+) | 9 | ✅ | ❌ | v8.3.2 |
113
+ | v0.71-v0.79 | 4.1+ (TLS 1.2+) | 15.5 | ✅ | ❌ | v9.0.2 |
114
+ | v0.71+ | 4.1+ (TLS 1.2+) | 15.5 | ✅ | ❌ | v10+ |
114
115
  | v0.74+ | 4.1+ (TLS 1.2+) | 15.5 | ✅ | ✅ | v11+ |
115
116
 
116
117
  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.
@@ -173,7 +174,7 @@ If you would like to display an update confirmation dialog (an "active install")
173
174
 
174
175
  ## Releasing updates
175
176
 
176
- 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 using the `appzung releases deploy-react-native` command in the AppZung CLI, which will bundle your JavaScript files, asset files, and release the update to the CodePush server.
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.
177
178
 
178
179
  ### Locally
179
180
 
@@ -258,7 +259,7 @@ This is not necessarily the case for `updateDialog`, since it won't force the us
258
259
 
259
260
  ## Debugging / Troubleshooting
260
261
 
261
- 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 release channel public ID?), 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:support@appzung.com) if you find it to be confusing or missing anything.
262
+ The `withCodePush`/`sync` methods include 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 release channel public ID?), 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:support@appzung.com) if you find it to be confusing or missing anything.
262
263
 
263
264
  Start up the Chrome DevTools Console, the Xcode Console (iOS) and/or ADB logcat (Android), and look for messages which are prefixed with `[CodePush]`.
264
265
 
@@ -274,12 +275,13 @@ Note that by default, React Native logs are disabled on iOS in release builds, s
274
275
 
275
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:
276
277
 
277
- | Issue / Symptom | Possible Solution |
278
- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
279
- | 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. |
280
- | 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. |
281
- | 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. |
282
- | 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. |
283
- | 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. |
284
- | 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 |
285
- | 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. |
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
+ | 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. |
@@ -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
 
@@ -5,6 +5,7 @@ import android.content.SharedPreferences;
5
5
  import android.os.AsyncTask;
6
6
  import android.os.Handler;
7
7
  import android.os.Looper;
8
+ import android.view.Choreographer;
8
9
  import android.view.View;
9
10
 
10
11
  import androidx.annotation.OptIn;
@@ -24,7 +25,6 @@ import com.facebook.react.bridge.ReadableMap;
24
25
  import com.facebook.react.bridge.WritableMap;
25
26
  import com.facebook.react.common.annotations.UnstableReactNativeAPI;
26
27
  import com.facebook.react.devsupport.interfaces.DevSupportManager;
27
- import com.facebook.react.modules.core.ChoreographerCompat;
28
28
  import com.facebook.react.modules.core.DeviceEventManagerModule;
29
29
  import com.facebook.react.modules.core.ReactChoreographer;
30
30
  import com.facebook.react.modules.debug.interfaces.DeveloperSettings;
@@ -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
- // #2) Update the locally stored JS bundle file path
214
- setJSBundle(getReactHostDelegate((ReactHostImpl) reactHost), latestJSBundleFile);
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 {
@@ -462,7 +468,7 @@ public class CodePushNativeModule extends BaseJavaModule {
462
468
  getReactApplicationContext().runOnUiQueueThread(new Runnable() {
463
469
  @Override
464
470
  public void run() {
465
- ReactChoreographer.getInstance().postFrameCallback(ReactChoreographer.CallbackType.TIMERS_EVENTS, new ChoreographerCompat.FrameCallback() {
471
+ ReactChoreographer.getInstance().postFrameCallback(ReactChoreographer.CallbackType.TIMERS_EVENTS, new Choreographer.FrameCallback() {
466
472
  @Override
467
473
  public void doFrame(long frameTimeNanos) {
468
474
  if (!latestDownloadProgress.isCompleted()) {
@@ -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
+ }
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- const version = exports.version = '11.0.0-rc8';
8
+ const version = exports.version = '11.0.0';
9
9
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version","exports"],"sourceRoot":"../../../src","sources":["internals/version.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,YAAY","ignoreList":[]}
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,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  // Generated by genversion.
4
- export const version = '11.0.0-rc8';
4
+ export const version = '11.0.0';
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version"],"sourceRoot":"../../../src","sources":["internals/version.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,YAAY","ignoreList":[]}
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-rc8";
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,eAAe,CAAC"}
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-rc8";
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,eAAe,CAAC"}
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-rc8",
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",
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '11.0.0-rc8';
2
+ export const version = '11.0.0';