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

Compare commits

...

2 Commits

Author SHA1 Message Date
sunnylqm
05738ec204 fix android build 2025-04-11 10:17:08 +08:00
sunnylqm
e4ef93595b feat: enhance Pushy logging with version info and update EventData interface 2025-04-10 12:25:16 +08:00
5 changed files with 16 additions and 9 deletions

View File

@@ -204,17 +204,18 @@ const styles = StyleSheet.create({
});
// use Pushy for China users
// const updateClient = new Pushy({
const updateClient = new Pushy({
appKey,
debug: true,
// updateStrategy: 'silentAndLater',
});
// use Cresc for global users
// const updateClient = new Cresc({
// appKey,
// debug: true,
// });
// use Cresc for global users
const updateClient = new Cresc({
appKey,
debug: true,
});
export default function Root() {
return (
<UpdateProvider client={updateClient}>

View File

@@ -99,7 +99,7 @@ public class UpdateModule extends NativePushySpec {
@Override
public void restartApp(Promise promise) {
UpdateModuleImpl.restartApp(updateContext, mContext, promise);
UpdateModuleImpl.restartApp(mContext, promise);
}
@Override

View File

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

View File

@@ -26,6 +26,7 @@ import {
setLocalHashInfo,
isFirstTime,
isRolledBack,
getCurrentVersionInfo,
} from './core';
const SERVER_PRESETS = {
@@ -128,6 +129,7 @@ export class Pushy {
log(type + ' ' + message);
await this.loggerPromise.promise;
const { logger = noop, appKey } = this.options;
const info = await getCurrentVersionInfo();
logger({
type,
data: {
@@ -137,6 +139,7 @@ export class Pushy {
packageVersion,
buildTime,
message,
...info,
...data,
},
});

View File

@@ -54,6 +54,9 @@ export interface EventData {
message?: string;
rolledBackVersion?: string;
newVersion?: string;
name?: string;
description?: string;
metaInfo?: string;
[key: string]: any;
}