Search code examples
androidparse-platform

How to change Parse push notification icon in android?


In my application i have used parse cloud code for sending push notifications to user.By default notification icon used app icon.but I want to change notification icon . I used this below code in manifest xml

<meta-data android:name="com.parse.push.notification_icon" android:resource="@drawable/noti_icon"/>

But the icon will not change. Any way to achieve this??


Solution

  • In PushService, each of the setDefaultPushCallback() and subscribe() methods allows an extra parameter to specify the icon:

    PushService.setDefaultPushCallback(context, SomeActivity.class, R.drawable.customIcon)
    
    PushService.subscribe(context, "ChannelName", SomeActivity.class, R.drawable.customIcon)