Why is not the notification icon displayed with the screen blocked?

0

While I have the phone unlocked and this in my application the notifications arrive as well as they should be but when I block or exit the application they arrive with a predetermined android icon. I've been several days and I have not found clear and precise information about this, I trust that it has already happened to someone else. I have already tried all the dimensions as the documentation says and it is still the same.

  

The first notification is when the device is active and the second is when it is blocked. My version api 23

                builder.setContentTitle(title)
                        .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_corazon))
                        .setSmallIcon(R.mipmap.notificacion_cereza)
                        .setColor(context.getResources().getColor(R.color.colorAccentLight))
                        .setContentText(aMessage) 
                        .setDefaults(Notification.DEFAULT_ALL)
                        .setStyle(new NotificationCompat.BigTextStyle().bigText(aMessage))
                        .addAction(new NotificationCompat.Action(R.drawable.ic_lounch_add, context.getResources().getString(R.string.seguir_comprando), pendingIntent))
                        .setAutoCancel(true)
                        .setContentIntent(pendingIntent)
                        .setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400})
                        .setPriority(Notification.PRIORITY_HIGH);

    
asked by yefri garcia 23.07.2018 в 21:22
source

1 answer

0

How about the problem you have and I think it is because in your manifest this code is not implemented in your manifest:

<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_ic_notification" />

<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorAccent" />
    
answered by 15.09.2018 / 01:33
source