Push Notifications Icons

Push Notifications Icons

in Android Lollipop (Android OS developed by Google, spanning versions between 5.0 and 5.1.1) all push notification icons are updated to the new material standards: https://developer.android.com/design/patterns/notifications.html.
The platform only respects icons with no color and only alpha levels. Old icons rendered in material display as a white square, for example:

android_push_notifications_icon

If you are supporting versions both before and after Lollipop, verify at runtime which icon to use.

You can accomplish this by:

TuneNotificationBuilder builder;
if (Build.VERSION.SDK_INT >= 21) {     
    builder = new TuneNotificationBuilder(R.drawable.lollipop_icon); 
} else {
    builder = new TuneNotificationBuilder(R.drawable.pre_lollipop_icon);
}
Tune.getInstance().setPushNotificationBuilder(builder);

No Comments

Leave a reply