Android Question Adaptive Icons & Status Bar

fbritop

Active Member
Licensed User
Longtime User
I have followed the guides to adaptive icons.
Icons on home screen looks perfect (adaptive). But when the app receives a Firebase message (when the app is not running so it just displays the icon on the status bar, it shows a round rectangle in grey with nothing else, also when yo expand the notification.

I have modified the maniest, also taking care of the "delete" line. I am playing only with standard notifications messages. I dont want to go any further with the NotificationBuilder. Why is the status bar and expanded view not showing an icon?. If I add to the payload in the firebase message the "icon" key, it still shows the same grey rectangle.
Also try with another post that put the files in reverse (background and foreground) with no luck. Also changing the mask from white to black, also with no luch
My files are:
1631293361555.png

The status bar shows:
1631293425496.png


Expanded notification:
1631293447608.png
 

TILogistic

Expert
Licensed User
Longtime User
see:

22 (?) - notifications icons colors are ignored. Alpha levels used as a mask.
 
Upvote 0

fbritop

Active Member
Licensed User
Longtime User
see:

Thanks,
After reading stackoverflow, it states that mipmap folder shoud contain a filename ic_notification.png
In the manifest, it should point there

B4X:
AddApplicationText(
<meta-data
    android:name="com.google.firebase.messaging.default_notification_color"
    android:resource="@color/icon" />
)   

SetApplicationAttribute(android:theme, "@style/Custom")
CreateResource(values-v20, theme.xml,
<resources>
  <style name="Custom" parent="@android:style/Theme.Material.Light.NoActionBar">
     <item name="android:windowTranslucentNavigation">false</item>
     <item name="android:windowBackground">@android:color/transparent</item>
     <item name="android:backgroundDimEnabled">false</item>
     <item name="android:windowTranslucentStatus">true</item>
     <item name="android:forceDarkAllowed">false</item>
     <item name="android:windowLightStatusBar">false</item>
        
  </style>
  <color name="icon">#1386FF</color>  <--- CUSTOM DEFINED BACKGROUND COLOR
</resources>
)

1631295667357.png
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
use:
It is very good and I have had no problems.

 
Upvote 1
Top