I'm using flutter_downloader: ^1.9.1
to download files. It's working fine, The file gets downloaded in the download folder. But the issue is after the file is downloaded the notification wrongly shows as failed and, On the notification click it's not redirecting to the download folder. Your help will save my day.
void _download(String url) async {
final status = await Permission.storage.request();
if (status.isGranted) {
final externalDir = await getExternalStorageDirectory();
final id = await FlutterDownloader.enqueue(
fileName: "LRMonoPhase4.mp3",
url: 'https://www.kozco.com/tech/LRMonoPhase4.mp3',
savedDir: '/storage/emulated/0/Download',
showNotification: true,
openFileFromNotification: true,
);
} else {
print('Permission Denied');
}
}
This is the provider
<provider
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
android:authorities="im.mingguang.mingguang_app.flutter_downloader.provider"
android:exported="false"
android:grantUriPermissions="true"
android:requestLegacyExternalStorage="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
Finally this is the Log
D/DownloadWorker( 4447): DownloadWorker{url=https://www.kozco.com/tech/LRMonoPhase4.mp3,filename=LRMonoPhase4.mp3,savedDir=/data/user/0/com.rsoft.salezrobot/app_flutter,header={},isResume=false,status=ENQUEUED
D/DownloadWorker( 4447): Update notification: {notificationId: 10, title: LRMonoPhase4.mp3, status: RUNNING, progress: 0}
D/DownloadWorker( 4447): Open connection to https://www.kozco.com/tech/LRMonoPhase4.mp3
D/DownloadWorker( 4447): Headers = {}
D/TrafficStats( 4447): tagSocket(172) with statsTag=0xffffffff, statsUid=-1
D/EGL_emulation( 4447): app_time_stats: avg=21.56ms min=5.27ms max=97.80ms count=47
I/trustAllHosts( 4447): checkServerTrusted
D/DownloadWorker( 4447): Content-Type = audio/mpeg
D/DownloadWorker( 4447): Content-Length = 931630
D/DownloadWorker( 4447): Charset = null
D/DownloadWorker( 4447): fileName = LRMonoPhase4.mp3
D/DownloadWorker( 4447): Update notification: {notificationId: 10, title: LRMonoPhase4.mp3, status: RUNNING, progress: 1}
D/EGL_emulation( 4447): app_time_stats: avg=19.26ms min=7.83ms max=39.89ms count=52
D/DownloadWorker( 4447): Update too frequently!!!!, this should be dropped
D/DownloadWorker( 4447): Update too frequently!!!!, this should be dropped