Alan W.
Alan W.

Reputation: 4716

how to set small and big icon for gcm notification when using notification payload

I'm using GCM 9.4.0. As the official doc of GCM, when using notificaiton payload,GCM handle notifications by itself,and notification messaging only has one parameter:icon for small icon.

so,how to set both small and big icon? Thanks for help.

Upvotes: 1

Views: 467

Answers (1)

Aditi
Aditi

Reputation: 389

try using this

Notification notification=notificationBuilder.build();
notification.contentView.setImageViewResource(android.R.id.icon, R.drawable.your_large_icon);

or

builder.setSmallIcon(R.drawable.my_small_icon);
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.my_96px_large_icon);
builder.setLargeIcon(bm);   

Upvotes: 1

Related Questions