1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 12:51:44 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Compare commits

...

5 Commits

Author SHA1 Message Date
Sunny Luo
7023ff57ca bump 10.29.4 2025-06-25 15:23:08 +08:00
波仔糕
17e21d79cf fix harmony image assets load fail issue (#505)
* modify harmony download logic to async

* fix harmony image assets load fail issue
2025-06-25 15:22:47 +08:00
Sunny Luo
1cab582bd0 Update package.json 2025-06-17 22:29:46 +08:00
波仔糕
7da5a165fd modify harmony download logic to async (#502) 2025-06-17 22:29:28 +08:00
sunnylqm
d5194a1ad1 bump version to 10.29.2 and add delayed execution for clearing first-time and rollback marks in UpdateModule 2025-06-16 12:00:19 +08:00
5 changed files with 21 additions and 8 deletions

View File

@@ -4,6 +4,8 @@ import static androidx.core.content.FileProvider.getUriForFile;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.ReactContext;
@@ -17,6 +19,7 @@ import java.util.Map;
public class UpdateModule extends NativePushySpec { public class UpdateModule extends NativePushySpec {
UpdateContext updateContext; UpdateContext updateContext;
public static ReactApplicationContext mContext; public static ReactApplicationContext mContext;
private final Handler handler = new Handler(Looper.getMainLooper());
public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) { public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) {
super(reactContext); super(reactContext);
this.updateContext = updateContext; this.updateContext = updateContext;
@@ -38,12 +41,22 @@ public class UpdateModule extends NativePushySpec {
boolean isFirstTime = updateContext.isFirstTime(); boolean isFirstTime = updateContext.isFirstTime();
constants.put("isFirstTime", isFirstTime); constants.put("isFirstTime", isFirstTime);
if (isFirstTime) { if (isFirstTime) {
updateContext.clearFirstTime(); handler.postDelayed(new Runnable() {
@Override
public void run() {
updateContext.clearFirstTime();
}
}, 2000);
} }
String rolledBackVersion = updateContext.rolledBackVersion(); String rolledBackVersion = updateContext.rolledBackVersion();
constants.put("rolledBackVersion", rolledBackVersion); constants.put("rolledBackVersion", rolledBackVersion);
if (rolledBackVersion != null) { if (rolledBackVersion != null) {
updateContext.clearRollbackMark(); handler.postDelayed(new Runnable() {
@Override
public void run() {
updateContext.clearRollbackMark();
}
}, 2000);
} }
constants.put("uuid", updateContext.getKv("uuid")); constants.put("uuid", updateContext.getKv("uuid"));
return constants; return constants;

Binary file not shown.

View File

@@ -73,7 +73,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadPatchFromPpk(
const jsi::Value* args, const jsi::Value* args,
size_t count) size_t count)
{ {
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadPatchFromPpk", args, count)); return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadPatchFromPpk", args, count));
} }
static jsi::Value _hostFunction_PushyTurboModule_downloadPatchFromPackage( static jsi::Value _hostFunction_PushyTurboModule_downloadPatchFromPackage(
@@ -82,7 +82,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadPatchFromPackage(
const jsi::Value* args, const jsi::Value* args,
size_t count) size_t count)
{ {
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadPatchFromPackage", args, count)); return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadPatchFromPackage", args, count));
} }
static jsi::Value _hostFunction_PushyTurboModule_downloadFullUpdate( static jsi::Value _hostFunction_PushyTurboModule_downloadFullUpdate(
@@ -91,7 +91,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadFullUpdate(
const jsi::Value* args, const jsi::Value* args,
size_t count) size_t count)
{ {
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadFullUpdate", args, count)); return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadFullUpdate", args, count));
} }
static jsi::Value _hostFunction_PushyTurboModule_downloadAndInstallApk( static jsi::Value _hostFunction_PushyTurboModule_downloadAndInstallApk(
@@ -100,7 +100,7 @@ static jsi::Value _hostFunction_PushyTurboModule_downloadAndInstallApk(
const jsi::Value* args, const jsi::Value* args,
size_t count) size_t count)
{ {
return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).call(rt,"downloadAndInstallApk", args, count)); return jsi::Value(static_cast<ArkTSTurboModule &> (turboModule).callAsync(rt,"downloadAndInstallApk", args, count));
} }

View File

@@ -12,7 +12,7 @@ export class PushyFileJSBundleProvider extends JSBundleProvider {
this.updateContext = new UpdateContext(context); this.updateContext = new UpdateContext(context);
} }
getURL(): string { getURL(): string {
return this.updateContext.getBundleUrl(); return this.updateContext.getBundleUrl().substring(1);
} }
async getBundle(): Promise<ArrayBuffer> { async getBundle(): Promise<ArrayBuffer> {

View File

@@ -1,6 +1,6 @@
{ {
"name": "react-native-update", "name": "react-native-update",
"version": "10.29.1", "version": "10.29.4",
"description": "react-native hot update", "description": "react-native hot update",
"main": "src/index", "main": "src/index",
"scripts": { "scripts": {