flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

No way to change notification icon on android. Always show a grey circle.

Open sagarmahobia opened this issue 4 years ago • 2 comments

sagarmahobia avatar Nov 01 '21 13:11 sagarmahobia

If you want to use a custom notification icon add the code below to the AndroidManifest.xml in your project.

<meta-data
    android:name="vn.hunghd.flutterdownloader.NOTIFICATION_ICON"
    android:resource="@drawable/ic_stat_logo" />

You can also use icons-launcher to create your drawables.

838 avatar Nov 18 '21 09:11 838

According to the official example, you should add NOTIFICATION_ICON https://github.com/fluttercommunity/flutter_downloader/blob/master/example/android/app/src/main/AndroidManifest.xml

<!-- Begin FlutterDownloader customization -->
        <!-- disable default Initializer -->
        <provider
            android:name="androidx.startup.InitializationProvider"
            android:authorities="${applicationId}.androidx-startup"
            android:exported="false"
            tools:node="merge">
            <meta-data
                android:name="androidx.work.WorkManagerInitializer"
                android:value="androidx.startup"
                tools:node="remove" />
        </provider>

        <!-- declare customized Initializer -->
        <provider
            android:name="vn.hunghd.flutterdownloader.FlutterDownloaderInitializer"
            android:authorities="${applicationId}.flutter-downloader-init"
            android:exported="false">
            <meta-data
                android:name="vn.hunghd.flutterdownloader.MAX_CONCURRENT_TASKS"
                android:value="5" />
        </provider>
        <!-- End FlutterDownloader customization -->

		<meta-data
    		android:name="vn.hunghd.flutterdownloader.NOTIFICATION_ICON"
    		android:resource="@drawable/ic_stat_logo" />

essasabbagh avatar Jun 02 '24 07:06 essasabbagh