mirzemehdi / KMPNotifier

Kotlin Multiplatform Push Notification Library targetting android, iOS, Desktop and Web (JS and Wasm)
http://mirzemehdi.com/KMPNotifier/
Apache License 2.0
300 stars 16 forks source link

Notification icon is different based on if app is in foreground or background(Android) #17

Closed dominikdoric closed 5 months ago

dominikdoric commented 6 months ago

I followed documentation but it seems I can't really control notification icon, when application is in foreground and push notification arrives it's icon is just grey circle and not application icon as it should be and I can't change it.

mirzemehdi commented 6 months ago

@dominikdoric It is related to android notification guideline. Notification icon should be one color.

You can check this: https://stackoverflow.com/questions/40404916/android-notification-icon-is-a-white-circle.

Also for Firebase you can set default notification by adding this to AndroidManifest.xml:

<!-- Set custom default icon. This is used when no icon is set for incoming notification messages. -->
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/ic_notification" />

<!--  Set color used with incoming notification messages. This is used when no color is set for the incoming notification message.  -->
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/orange" />
mirzemehdi commented 5 months ago

Closing this issue due to inactivity. If this is still an issue or need a help, please feel free to reopen the issue and provide additional context or updates. Thank you.