# PushEventListener

public interface PushEventListener

## Functions

afterNotificationMessageArrived
Link copied to clipboard
public abstract void afterNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage)
接收到第三方推送平台的推送到达事件时的回调。 此时通知已由手机平台弹出，无法自定义。
onGetTokenError
Link copied to clipboard
public void onGetTokenError(PushType pushType, long code, String errorMessage)
获取 token 失败回调
onGetTokenServer
Link copied to clipboard
public void onGetTokenServer(boolean isSuccess)
获取 push token 上报服务器地址回调
onNotificationMessageClicked
Link copied to clipboard
public abstract boolean onNotificationMessageClicked(Context context, PushType pushType, PushNotificationMessage notificationMessage)
通知点击时的回调。
onPreferPushType
Link copied to clipboard
public void onPreferPushType(List<PushType> preferType)
获取到最合适推送类型回调
onPushConfigInitFinish
Link copied to clipboard
public void onPushConfigInitFinish(Builder pushConfig)
使用 Push 2.
onStartRegister
Link copied to clipboard
public void onStartRegister(List<PushType> preferTypes)
开始注册推送
onStartTokenReport
Link copied to clipboard
public List<TokenBean> onStartTokenReport(List<TokenBean> tokenList)
sdk 即将上报推送 token 时回调此方法，用户可以通过此接口,调整推送注册顺序，sdk会根据调整顺序上报
onThirdPartyPushState
Link copied to clipboard
public abstract void onThirdPartyPushState(PushType pushType, String action, long resultCode)
第三方推送设置状态回调
onTokenReceived
Link copied to clipboard
public abstract void onTokenReceived(PushType pushType, String token)
收到 推送 token 回调
onTokenReportResult
Link copied to clipboard
public abstract void onTokenReportResult(PushType reportType, int code, PushType finalType, String finalToken)
public void onTokenReportResult(PushType reportType, int code, PushType finalType, String finalToken, String message)
public void onTokenReportResult(PushType reportType, int code, PushType finalType, String finalToken, String message, Map<String, String> failMap)
token 上报回调
preNotificationMessageArrived
Link copied to clipboard
public abstract boolean preNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage)
通知显示之前的回调，用户可拦截此事件进行通知自定义显示。 融云默认推送、华为数据透传方式推送、 FCM 数据方式推送会回调此方法。