Giter Club home page Giter Club logo

Comments (2)

emri99 avatar emri99 commented on July 18, 2024 1

Hello,

I was facing the same issue, and now that it's resolved I don't think this plugin is responsible.

Here's the workaround I've found.

My push notification provider is Batch, and use FirebaseCloudMessaging internally, so I first add a section in the application part of AndroidManifest.xml :

<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
     See README(https://goo.gl/l4GJaQ) for more. -->
<meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/ic_launcher_foreground" />
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
     notification message. See README(https://goo.gl/6BKBk7) for more. -->
<meta-data
    android:name="com.google.firebase.messaging.default_notification_color"
    android:resource="@color/ic_launcher_background" />

From : https://firebase.google.com/docs/cloud-messaging/android/client#manifest
(I only add the optional section about icon)

Unfortunately, the icon was visible but icon background color was always black.
I resolve this issue by following Batch documentation, the naming of properties above are slightly different.

Notice: the icon for notification is used as a mask. That implies it must have a transparent background and all colored part will have same color when shown in notification context.

Hope my xp can lead you to a fix 😃 🤞

from flutter_launcher_icons.

desmeit avatar desmeit commented on July 18, 2024

@emri99 thanks.
I found a fix as well:

  • name your icon "app_icon.png" and place it in the drawable folder
  • edit your keep.xml in the raw folder: tools:keep="@drawable/*,@raw/sound" (if your soundfile name is sound.mp3)
  • add the name of the file in the settings: AndroidInitializationSettings('app_icon');

keep in mind:
notification icon should be white on transparent color. you can create it in Android Studio > right click on resources > New Image Asset > Notification Icon

from flutter_launcher_icons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.