This issue might comes from the strict guideline of Android 15 "monochrome" color policy, When it encounters your icon file, it sees your color information (or other pixel data that doesn't conform to the all-white, transparent-background rule) and instead of trying to render it, it displays the default fallback, which is the gray square inside a circle.
Here are solution steps you can try:
- Create and use a new icon file:
Create a new PNG icon file and adheres the following rule:
- The icon must be solid white color
- The background must be completely transparent
- Use an SVG or a high-resolution PNG file to ensure it looks good on all screen densities. The recommended size is 24x24 dp.
You can use tool like Android Asset Studio to easilly generate a proper notification icon.
- Add the new icon to your project
- Save this new, monochrome icon file.
- Place it in your
Platforms/Android/Resources/drawable
folder. - Name it something like
ic_notification_small.png
. - Ensure its build action is set to AndroidResource.
- Update your code
- Update your C# code to reference to this icon:
private void CreateNotificationChannel()
{
try
{
var channelId = $"{PackageName}.general";
var notificationManager = (NotificationManager)GetSystemService(NotificationService);
var channel = new NotificationChannel(channelId, "General", NotificationImportance.Default);
notificationManager.CreateNotificationChannel(channel);
FirebaseCloudMessagingImplementation.ChannelId = channelId;
// Update this line to point to your new monochrome icon.
FirebaseCloudMessagingImplementation.SmallIconRef = global::ProjectNameSpace.Resource.Drawable.ic_notification_small;
}
catch (Exception exception)
{
Utility.SendCrashReport(exception);
}
}
4. Rebuild the project
- Clean and rebuild your project to ensure the new resources are properly integrated.
These changes should provide Android 15 with a compatible icon that displays correctly in the notification area.
Here are some useful source you can find:
- Google could change up how Android shows notifications in the status bar
- Older Android 13+ color relate issue
- Android 15 brings even more improvements to Material You design
I hope this help! Let me know if you have any question