【发布时间】:2015-08-22 15:31:42
【问题描述】:
我使用Parse push notification 向用户发送一些消息。
但我想以编程方式更改每条消息的通知图标。
我该怎么做?
【问题讨论】:
标签: android parse-platform push-notification android-notifications
我使用Parse push notification 向用户发送一些消息。
但我想以编程方式更改每条消息的通知图标。
我该怎么做?
【问题讨论】:
标签: android parse-platform push-notification android-notifications
您可以拦截onPushReceived 并创建自己的通知并设置图标。
最简单的方法应该是传递 PushService.subscribe() 上的图标,调用 PushService.subscribe(context, channel, activity, icon)
PushService.setDefaultPushCallback(context, SomeActivity.class, R.drawable.customIcon)
PushService.subscribe(context, "ChannelName", SomeActivity.class, R.drawable.customIcon)
如果您只想使用不同的图标,请将其添加到清单中:
<meta-data android:name="com.parse.push.notification_icon" android:resource="@drawable/push_icon"/>
【讨论】: