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

add cresc

This commit is contained in:
sunnylqm
2025-02-18 13:16:37 +08:00
parent 0b52cf35d2
commit bbda7217ac
8 changed files with 91 additions and 66 deletions

View File

@@ -13,8 +13,12 @@ export const PushyModule =
? require('./NativePushy').default
: NativeModules.Pushy;
export const UpdateModule = PushyModule;
if (!PushyModule) {
throw new Error('react-native-update 模块无法加载,请尝试重新编译');
throw new Error(
'Failed to load react-native-update native module, please try to recompile',
);
}
const PushyConstants = isTurboModuleEnabled
@@ -31,12 +35,6 @@ export const isRolledBack: boolean = typeof rolledBackVersion === 'string';
export const buildTime: string = PushyConstants.buildTime;
let uuid = PushyConstants.uuid;
if (Platform.OS === 'android' && !PushyConstants.isUsingBundleUrl) {
console.warn(
'react-native-update 没有检测到 Bundle URL 的配置,这可能是因为您使用了某种懒加载机制(比如使用 expo可忽略本警告或是 Bundle URL 的配置不正确(请对照文档检查)',
);
}
export function setLocalHashInfo(hash: string, info: Record<string, any>) {
PushyModule.setLocalHashInfo(hash, JSON.stringify(info));
}
@@ -63,7 +61,7 @@ if (!uuid) {
log('uuid: ' + uuid);
export const cInfo = {
pushy: require('../package.json').version,
rnu: require('../package.json').version,
rn: RNVersion,
os: Platform.OS + ' ' + Platform.Version,
uuid,