public abstract class DefaultInterceptor extends java.lang.Object implements NotificationConfig.Interceptor
| Constructor and Description |
|---|
DefaultInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isHighPriorityMessage(Message message)
是否为高优先级消息。高优先级消息不受全局静默时间和会话免打扰控制,比如 @ 消息。
|
boolean |
isNotificationIntercepted(Message message)
是否拦截此本地通知,一般用于自定义本地通知的显示。
|
android.app.PendingIntent |
onPendingIntent(android.app.PendingIntent pendingIntent,
android.content.Intent intent)
设置本地通知 PendingIntent 时的回调。
应用层可通过此方法更改 PendingIntent 里的设置,以便自定义本地通知的点击行为。
点击本地通知时,SDK 默认跳转到对应会话页面。
|
android.app.NotificationChannel |
onRegisterChannel(android.app.NotificationChannel defaultChannel)
注册默认 channel 之前的回调。可以通过此方法拦截并修改默认 channel 里的配置,将修改后的 channel 返回。
|
public boolean isNotificationIntercepted(Message message)
isNotificationIntercepted in interface NotificationConfig.Interceptormessage - 本地通知对应的消息public android.app.PendingIntent onPendingIntent(android.app.PendingIntent pendingIntent,
android.content.Intent intent)
onPendingIntent in interface NotificationConfig.InterceptorpendingIntent - SDK 默认 PendingIntentintent - pendingIntent 里携带的 intent。
可通过 intent 获取以下信息:
intent.getStringExtra(RouteUtils.CONVERSATION_TYPE);
intent.getStringExtra(RouteUtils.TARGET_ID);
intent.getParcelableExtra(RouteUtils.MESSAGE);public boolean isHighPriorityMessage(Message message)
isHighPriorityMessage in interface NotificationConfig.Interceptormessage - 接收到的消息public android.app.NotificationChannel onRegisterChannel(android.app.NotificationChannel defaultChannel)
onRegisterChannel in interface NotificationConfig.InterceptordefaultChannel - 默认通知频道