You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.
import RNBackgroundDownloader from 'react-native-background-downloader';
let task = RNBackgroundDownloader.download({
id: 'file123',
url: 'https://link-to-very.large/file.zip'
destination: `${RNBackgroundDownloader.directories.documents}/file.zip`
}).begin((expectedBytes) => {
console.log(`Going to download ${expectedBytes} bytes!`);
}).progress((percent) => {
console.log(`Downloaded: ${percent * 100}%`);
}).done(() => {
console.log('Download is done!');
}).error((error) => {
console.log('Download canceled due to error: ', error);
});
// Pause the task
task.pause();
// Resume after pause
task.resume();
// Cancel the task
task.stop();
Lets assume you want to wrap the Download Process in a Promise and you want to resolve and reject the promises with the available callbacks. It its possible, but when you want to stop, pause or resume the task there is no callback for this.
So you cant resolve or reject a promise if you stop the task.
So my Feature Request is: Can you add at least a Callback for stop and prefeably for pause and resume too?
Expected Behavior
Callbacks for every status change on a task.
Actual Behavior
No Callbacks for stop, pause and resume
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is this a bug report, a feature request, or a question?
Feature Request
Have you followed the required steps before opening a bug report?
(Check the step you've followed - put an
x
character between the square brackets ([]
).)Description
You instantiate a Download like this:
Lets assume you want to wrap the Download Process in a Promise and you want to resolve and reject the promises with the available callbacks. It its possible, but when you want to stop, pause or resume the task there is no callback for this.
So you cant resolve or reject a promise if you stop the task.
So my Feature Request is: Can you add at least a Callback for stop and prefeably for pause and resume too?
Expected Behavior
Callbacks for every status change on a task.
Actual Behavior
No Callbacks for stop, pause and resume
The text was updated successfully, but these errors were encountered: