4,158 questions
MAUI: Notification icon is blank in Android 15
Sreejith Sreenivasan
1,001
Reputation points
I am using below code to show the push notification icon in my MAUI application:
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;
FirebaseCloudMessagingImplementation.SmallIconRef = global::ProjectNameSpace.Resource.Drawable.ic_notification;
}
catch (Exception exception)
{
Utility.SendCrashReport(exception);
}
}
This icon is working fine upto android version 14, but in 15 the icon is breaking. Check the below screenshot. Inside the blue circle a grey square is showing, the real icon is not showing. I have added the icon in Platforms-Android-Resource-Drawable and build action set to None.
I also tried using the app icon from single project like below, but no luck.
using Resource = Microsoft.Maui.Resource;
FirebaseCloudMessagingImplementation.SmallIconRef = Resource.Mipmap.appicon;
Developer technologies | .NET | .NET MAUI
Sign in to answer