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
907 stars 511 forks source link

Notification not showing on android device status bar #902

Closed shajedul-bdfare closed 11 months ago

shajedul-bdfare commented 11 months ago
await FlutterDownloader.enqueue(
            headers: headers,
            url: baseUrl + url,
            fileName: !isNull(fileName) ? "$fileName.pdf" : null,
            savedDir: saveDirectory.path,
            showNotification: true,
            openFileFromNotification: true,
            saveInPublicStorage: true,
   );

Notification icon when downloading/downloaded is not showing in status bar but its showing on notification panel. Any idea whats wrong?

shajedul-bdfare commented 11 months ago

Note: it seems the flutter_downloader package's own notification is set to Silent by default. If I change it from app settings it works. How can I achieve this in code?

salmaahhmed commented 11 months ago

@shajedul-bdfare hey thanks! i will take a look on it.

salmaahhmed commented 11 months ago

@shajedul-bdfare can you please add this in your manifest file and let me know how it goes? <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

shajedul-bdfare commented 11 months ago

@salmaahhmed Nop its not working.

I think while creating notification, setting 'importance' to default/high will help. I am not sure. Just my thought.

houcemzenakhra commented 11 months ago

same here

salmaahhmed commented 11 months ago

@houcemzenakhra @shajedul-bdfare according to android permission documentation for targeting android 13 (API Level 33) notifications are off by default and we need to show a permission dialog. You can use the package permission_handler at the moment until I take a look into possible solutions for this plugin.

You will have to add in your manifest <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> and then use Permission.notification.request()

jaythakkarBAPS commented 1 week ago

same issue facing not showing media control above android 13