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

resolve harmony hot update fail issue (#483)

* fix harmony more than 2M issue

* fix mtpush-react-native conflics

* update harmony remote dependency flow

* udpate

* udpate

* udpate

* udpate

* udpate

* update

* uddate

* udpapte

* adapter pushy for Expo

* udpate

* resolve harmony hot update fail issue

* udpate

* udpate

* udpate

* udpate

* udpate

* update

* udpate
This commit is contained in:
波仔糕
2025-03-09 10:08:30 +08:00
committed by GitHub
parent 93f2d51c46
commit 3876110a66
9 changed files with 91 additions and 69 deletions

View File

@@ -9,7 +9,7 @@ import {
promiseAny,
testUrls,
} from './utils';
import { EmitterSubscription, Platform } from 'react-native';
import { EmitterSubscription, Platform, DeviceEventEmitter } from 'react-native';
import { PermissionsAndroid } from './permissions';
import {
PushyModule,
@@ -350,14 +350,25 @@ export class Pushy {
return;
}
if (onDownloadProgress) {
Pushy.progressHandlers[hash] = pushyNativeEventEmitter.addListener(
'RCTPushyDownloadProgress',
progressData => {
if (progressData.hash === hash) {
onDownloadProgress(progressData);
}
},
);
if (Platform.OS === 'harmony') {
Pushy.progressHandlers[hash] = DeviceEventEmitter.addListener(
'RCTPushyDownloadProgress',
progressData => {
if (progressData.hash === hash) {
onDownloadProgress(progressData);
}
},
);
} else {
Pushy.progressHandlers[hash] = pushyNativeEventEmitter.addListener(
'RCTPushyDownloadProgress',
progressData => {
if (progressData.hash === hash) {
onDownloadProgress(progressData);
}
},
);
}
}
let succeeded = '';
this.report({ type: 'downloading' });