Releases: kathawala/expo-file-dl
2.0.0
This release adds an option for one to retrieve information on the progress of a download, by passing a callback which matches the following type (from expo-filesystem
):
export type DownloadProgressCallback = (data: DownloadProgressData) => void;
export type DownloadProgressData = {
totalBytesWritten: number;
totalBytesExpectedToWrite: number;
};
A good example of the kind of callback you might want to pass in here is available in the README
Breaking Changes
Previously downloadToFolder
was called as follows (with the latter two arguments being optional):
await downloadToFolder(uri, filename, folder, channelId, {notification: 'custom'}, customNotificationConfig);
Now, with the new option to add a callback to retrieve download progress, the optional arguments have been grouped together
in one options
argument (with only the options
argument being optional), as follows:
await downloadToFolder(uri, filename, folder, channelId, {
notificationType: {notification: 'custom'},
notificationContent: customNotificationConfig,
downloadProgressCallback: callback,
});
1.1.0
All dependencies updated to work with Expo SDK 40. Now allows for downloading any and all file types on iOS. Images on iOS download straight to the Photo Library, all other files on iOS the user must manually select to save them to the filesystem. Android is unchanged.