Skip to content

[Android] How to change notification icon

Elvin (Tharindu) Thudugala edited this page Aug 1, 2022 · 5 revisions

You can change the notification icon by setting NotificationRequest.Android.IconSmallName

var notification = new NotificationRequest
{
    NotificationId = 100,
    Title = "Test",
    Description = "Test Description",
    Android =
    {
        IconSmallName =
        {
              ResourceName = "my_icon",
        }            
    }
};
await LocalNotificationCenter.Current.Show(notification);

.Net MAUI

after that add "my_icon.png" to Resources/Images

image

Xamarin.Forms

after that add "my_icon.png" to Android Project Resources/drawable

image

Set the small icon to use in the notification layouts. Different classes of devices may return in different sizes. See the UX guidelines for more information on how to design these icons.

If Icon not displaying in the notification, a white square is shown instead

Please follow Google's Design Guidelines https://material.io/design/platform-guidance/android-notifications.html#behavior