Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downloadProgressCallback not working in IOS #2790

Open
ahsanparacha02 opened this issue Dec 26, 2024 · 11 comments
Open

downloadProgressCallback not working in IOS #2790

ahsanparacha02 opened this issue Dec 26, 2024 · 11 comments

Comments

@ahsanparacha02
Copy link

ahsanparacha02 commented Dec 26, 2024

When upgrading from version v8.0.2 to v9.0.1 in React Native 0.76.5, the downloadProgressCallback does not trigger for iOS, while it works fine on Android. It only triggers once the bundle download is complete.

Here is code snippet.

`
async sync() {
CodePush.sync(
{ installMode: CodePush.InstallMode.IMMEDIATE, updateDialog: false },
this.codePushStatusDidChange,
this.codePushDownloadDidProgress
);
CodePush.allowRestart();
}

codePushDownloadDidProgress(event){
this.setState({
progress: (event.receivedBytes / event.totalBytes).toFixed(2) * 100,
});
MyToast.popToast(
Progress ${(event.receivedBytes / event.totalBytes).toFixed(2) * 100}
);
};
`

@IlyaBausovAkvelon
Copy link

Hi @ahsanparacha02,
Thank you for reporting this issue. Could you please provide us demo app so we could reproduce this issue?

@ahsanparacha02
Copy link
Author

ahsanparacha02 commented Jan 16, 2025

Hi @ahsanparacha02, Thank you for reporting this issue. Could you please provide us demo app so we could reproduce this issue?

Android:

Image

Iphone

Image

Mentioned screenshot shows that the iOS progress bar is not updating. The receivedBytes and totalBytes events are not being triggered on iOS.

codePushDownloadDidProgress(event){ this.setState({ progress: (event.receivedBytes / event.totalBytes).toFixed(2) * 100, });};

@IlyaBausovAkvelon
Copy link

@ahsanparacha02 Could you please provide demo application so we could use it to reproduce issue on our side?

@ahsanparacha02
Copy link
Author

@ahsanparacha02 Could you please provide demo application so we could use it to reproduce issue on our side?

Do you need ipa file?

@DordeDimitrijev
Copy link
Contributor

We need a small demo project in which you can reproduce this issue, that way we can debug the source code and see what's going on. Ipa won't do it since it is an archive containing compiled code.

@felipegmg
Copy link

same problem!

@ahsanparacha02
Copy link
Author

We need a small demo project in which you can reproduce this issue, that way we can debug the source code and see what's going on. Ipa won't do it since it is an archive containing compiled code.

https://github.com/ahsanparacha02/RNCodepush.git

Image

@ahsanparacha02
Copy link
Author

ahsanparacha02 commented Jan 29, 2025 via email

@ahsanparacha02
Copy link
Author

We need a small demo project in which you can reproduce this issue, that way we can debug the source code and see what's going on. Ipa won't do it since it is an archive containing compiled code.

any update ?

@MikhailSuendukov
Copy link
Contributor

I added additional logging in codePushDownloadDidProgress and confirmed that it is being triggered. I successfully tested the iOS version and observed that the app immediately downloads the update, the progress bar jumps to 100%, and then the app restarts. After the restart, the label displays 0%. This behavior intentional by design.

@ahsanparacha02
Copy link
Author

I added additional logging in codePushDownloadDidProgress and confirmed that it is being triggered. I successfully tested the iOS version and observed that the app immediately downloads the update, the progress bar jumps to 100%, and then the app restarts. After the restart, the label displays 0%. This behavior intentional by design.

Yes, you are correct. However, if the bundle size increases above 10MB, the issue will replicate. Right now, in my app, the progress bar initially shows 0%. Once the bundle download is complete, it jumps directly to 100%. The progress between 0% and 100% is not being triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants