push-notificationflutter

How to Change the Android Notification Icon/Status Bar Icon for Push-notification in #flutter?


I want to replace the default Icon with my own icon for Push-notifications.

Now the App show the Icon as White box .


Solution

  • Just add a meta-data inside tag in your manifest file.

    Reference

    <!-- Set custom default icon. This is used when no icon is set for incoming notification messages. -->
    
    
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="When Coin"
        android:icon="@mipmap/ic_launcher">
    <meta-data
       android:name="com.google.firebase.messaging.default_notification_icon"
       android:resource="@mipmap/ic_stat_ic_notification" />
    

    NOTE: Before starting, make sure your icon/image has a transparent background. The solution will seem like it's not working if your image background has a color.

    Want to generate mipmap icons, try appicon.co/