react-native-update 10.29.1 → 10.29.3

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.
@@ -4,6 +4,8 @@ import static androidx.core.content.FileProvider.getUriForFile;
4
4
  import android.content.Intent;
5
5
  import android.net.Uri;
6
6
  import android.os.Build;
7
+ import android.os.Handler;
8
+ import android.os.Looper;
7
9
  import com.facebook.react.bridge.Promise;
8
10
  import com.facebook.react.bridge.ReactApplicationContext;
9
11
  import com.facebook.react.bridge.ReactContext;
@@ -17,6 +19,7 @@ import java.util.Map;
17
19
  public class UpdateModule extends NativePushySpec {
18
20
  UpdateContext updateContext;
19
21
  public static ReactApplicationContext mContext;
22
+ private final Handler handler = new Handler(Looper.getMainLooper());
20
23
  public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) {
21
24
  super(reactContext);
22
25
  this.updateContext = updateContext;
@@ -38,12 +41,22 @@ public class UpdateModule extends NativePushySpec {
38
41
  boolean isFirstTime = updateContext.isFirstTime();
39
42
  constants.put("isFirstTime", isFirstTime);
40
43
  if (isFirstTime) {
41
- updateContext.clearFirstTime();
44
+ handler.postDelayed(new Runnable() {
45
+ @Override
46
+ public void run() {
47
+ updateContext.clearFirstTime();
48
+ }
49
+ }, 2000);
42
50
  }
43
51
  String rolledBackVersion = updateContext.rolledBackVersion();
44
52
  constants.put("rolledBackVersion", rolledBackVersion);
45
53
  if (rolledBackVersion != null) {
46
- updateContext.clearRollbackMark();
54
+ handler.postDelayed(new Runnable() {
55
+ @Override
56
+ public void run() {
57
+ updateContext.clearRollbackMark();
58
+ }
59
+ }, 2000);
47
60
  }
48
61
  constants.put("uuid", updateContext.getKv("uuid"));
49
62
  return constants;
@@ -73,7 +73,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadPatchFromPpk(
73
73
  const jsi::Value* args,
74
74
  size_t count)
75
75
  {
76
- return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadPatchFromPpk", args, count));
76
+ return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadPatchFromPpk", args, count));
77
77
  }
78
78
 
79
79
  static jsi::Value _hostFunction_PushyTurboModule_downloadPatchFromPackage(
@@ -82,7 +82,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadPatchFromPackage(
82
82
  const jsi::Value* args,
83
83
  size_t count)
84
84
  {
85
- return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadPatchFromPackage", args, count));
85
+ return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadPatchFromPackage", args, count));
86
86
  }
87
87
 
88
88
  static jsi::Value _hostFunction_PushyTurboModule_downloadFullUpdate(
@@ -91,7 +91,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadFullUpdate(
91
91
  const jsi::Value* args,
92
92
  size_t count)
93
93
  {
94
- return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadFullUpdate", args, count));
94
+ return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadFullUpdate", args, count));
95
95
  }
96
96
 
97
97
  static jsi::Value _hostFunction_PushyTurboModule_downloadAndInstallApk(
@@ -100,7 +100,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadAndInstallApk(
100
100
  const jsi::Value* args,
101
101
  size_t count)
102
102
  {
103
- return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadAndInstallApk", args, count));
103
+ return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadAndInstallApk", args, count));
104
104
  }
105
105
 
106
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.29.1",
3
+ "version": "10.29.3",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {