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
On Android 14 and 15, Download direcroty auto clear all downloaded files after RNBackgroundDownloader.checkForExistingDownloads() executed
On android OS 14 and 15 after below code execute, It automatacally clear the ols downloaded files from App's Download Directory. I have searched everything, I am stuck with this issue from last 2 days.
let lostTasks = await RNBackgroundDownloader.checkForExistingDownloads(); console.info(Tasks ${lostTasks} was found!); for (let task of lostTasks) { console.info(task); console.info(Task ${task.id} was found!); tasks[task.id] = task; this.attachTask(task); }
App.js code const _handleAppStateChange = nextAppState => { if ( appState.current.match(/inactive|background/) && nextAppState === 'active' ) { console.log('App has come to the foreground! '); if (Platform.OS === 'android') { downloadService.rehydrate().then(); } }
download.js file code
`
import RNBackgroundDownloader from '@kesha-antonov/react-native-background-downloader'
rehydrate = async () => {
console.info('looking for existing task');
let tasks = {};
let lostTasks = await RNBackgroundDownloader.checkForExistingDownloads();
console.info(`Tasks ${lostTasks} was found!`);
for (let task of lostTasks) {
console.info(task);
console.info(`Task ${task.id} was found!`);
tasks[task.id] = task;
this.attachTask(task);
}
this.tasks = tasks;
return tasks;
};
If any docuement successfuly download then it should not delete file, if any download is fail then only delete it.
Actual Behavior
I am using ReactNativeBlobUtil.fetch('Get', url) to download the file, after successfuly download and open the .PDF file, when app re-launch the app, let lostTasks = await RNBackgroundDownloader.checkForExistingDownloads(); this method automatically delete the all downloaded files.
When I am using same this RNBackgroundDownloader Package for downloading file then file will not remove, If I use diff react-native package to download any document then this line 'RNBackgroundDownloader.checkForExistingDownloads()' will remove that particular file.
Steps to Reproduce
Download .pdf file using any other download package
minimize/close react-native app
relanuch the app, App will make clear the Download directory
in Android Studio LogCat print the below logs
2025-03-05 16:09:54.288 9955-9963 DownloadManager android.process.media V Deleting /storage/emulated/0/Android/data/com.XXXXXX.xxx/files/Download/SAT_MOKSH.pdf via provider delete
Thank You, Please help me
The text was updated successfully, but these errors were encountered:
If I use same this package for any download then file will not delete but as I am using react-native-blob-util package for PDF download, file will automatically removed from download direcroty.
On Android 14 and 15, Download direcroty auto clear all downloaded files after RNBackgroundDownloader.checkForExistingDownloads() executed
On android OS 14 and 15 after below code execute, It automatacally clear the ols downloaded files from App's Download Directory. I have searched everything, I am stuck with this issue from last 2 days.
let lostTasks = await RNBackgroundDownloader.checkForExistingDownloads(); console.info(
Tasks ${lostTasks} was found!); for (let task of lostTasks) { console.info(task); console.info(
Task ${task.id} was found!); tasks[task.id] = task; this.attachTask(task); }
App.js code
const _handleAppStateChange = nextAppState => { if ( appState.current.match(/inactive|background/) && nextAppState === 'active' ) { console.log('App has come to the foreground! '); if (Platform.OS === 'android') { downloadService.rehydrate().then(); } }
download.js file code
`
import RNBackgroundDownloader from '@kesha-antonov/react-native-background-downloader'
`
Environment
Environment:
React: 18.3.1
React native: 0.77.0
"@kesha-antonov/react-native-background-downloader": "^3.2.6",
Target Platform:
Android (14.0) & Android (15.0)
Expected Behavior
If any docuement successfuly download then it should not delete file, if any download is fail then only delete it.
Actual Behavior
I am using ReactNativeBlobUtil.fetch('Get', url) to download the file, after successfuly download and open the .PDF file, when app re-launch the app, let lostTasks = await RNBackgroundDownloader.checkForExistingDownloads(); this method automatically delete the all downloaded files.
When I am using same this RNBackgroundDownloader Package for downloading file then file will not remove, If I use diff react-native package to download any document then this line 'RNBackgroundDownloader.checkForExistingDownloads()' will remove that particular file.
Steps to Reproduce
2025-03-05 16:09:54.288 9955-9963 DownloadManager android.process.media V Deleting /storage/emulated/0/Android/data/com.XXXXXX.xxx/files/Download/SAT_MOKSH.pdf via provider delete
Thank You, Please help me
The text was updated successfully, but these errors were encountered: