fluttercommunity / flutter_downloader

Flutter Downloader - A plugin for creating and managing download tasks.
https://pub.dev/packages/flutter_downloader
BSD 3-Clause "New" or "Revised" License
913 stars 513 forks source link

flutter downloader is not downloading in Android versions of 13 and 14 #959

Open sabari7320 opened 5 months ago

sabari7320 commented 5 months ago

Describe the bug

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Screenshots

Desktop (please complete the following information):

Device information:

Additional context

sabari7320 commented 5 months ago

i have same issue if anyone knows exact solution let me know

sabari7320 commented 5 months ago

i resolved in my code has this issue

void PDFDownloadURL(String url,String name) async {
print("Applicant Resume download");
final mediastatus=await Permission.mediaLibrary.request();

print(mediastatus);

if(mediastatus.isGranted){
  final baseStorage=await getExternalStorageDirectory();
  final id=await FlutterDownloader.enqueue(
      url: url, savedDir:baseStorage!.path,
      fileName: "${name}_Resume.pdf",
    showNotification: true, // show download progress in status bar (for Android)
    openFileFromNotification: true, // click on notification to open downloaded file (for Android)
  );
}
else{
  print("NO permission");
}

} I added this Permission.mediaLibrary.request(); insted of Permission.storage.request();