Can I override default push notification icon in android from app icon to custom icon?

后端 未结 6 923
遥遥无期
遥遥无期 2021-02-12 16:16

Can I override default push notification icon in android from app icon to custom icon?

I am using default firebase implementation to display notification in system tray,

6条回答
  •  离开以前
    2021-02-12 16:49

    Builder class for Notification objects. Provides a convenient way to set the various fields of a Notification and generate content views using the platform's notification layout template. Check Official Documentation here

     Notification noti = new Notification.Builder(mContext)
         .setContentTitle("New mail from " + sender.toString())
         .setContentText(subject)
         .setSmallIcon(R.drawable.new_mail)
         .setLargeIcon(aBitmap)
         .build();
    

    Here you can set custom fields including Icon for your notifications.

    Cheers! Happy Coding

提交回复
热议问题