Package io.rong.push

Interface PushEventListener

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

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

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • preNotificationMessageArrived

         abstract boolean preNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage)

        通知显示之前的回调,用户可拦截此事件进行通知自定义显示。 融云默认推送、华为数据透传方式推送、 FCM 数据方式推送会回调此方法。

        Parameters:
        context - 上下文
        pushType - 推送类型
        notificationMessage - 推送消息
        Returns:

        是否拦截处理。true 代表此事件被拦截,sdk 不再处理;false, 按 sdk 默认逻辑处理

      • afterNotificationMessageArrived

         abstract void afterNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage)

        接收到第三方推送平台的推送到达事件时的回调。 此时通知已由手机平台弹出,无法自定义。

        Parameters:
        context - 上下文
        pushType - 推送类型
        notificationMessage - 推送消息
      • onNotificationMessageClicked

         abstract boolean onNotificationMessageClicked(Context context, PushType pushType, PushNotificationMessage notificationMessage)

        通知点击时的回调。

        Parameters:
        context - 上下文
        pushType - 推送类型
        notificationMessage - 推送消息
        Returns:

        事件是否被拦截处理。true, 代表事件被应用层拦截, sdk 不再处理;false, 按 sdk 默认逻辑处理。

      • onThirdPartyPushState

         abstract void onThirdPartyPushState(PushType pushType, String action, long resultCode)

        第三方推送设置状态回调

        Parameters:
        pushType - 推送类型
        action - 事件
        resultCode - 错误码
      • onTokenReceived

         abstract void onTokenReceived(PushType pushType, String token)

        收到 推送 token 回调

        Parameters:
        pushType - 推送类型
        token - 收到的 PushToken
      • onTokenReportResult

         abstract void onTokenReportResult(PushType reportType, int code, PushType finalType, String finalToken)

        token 上报回调

        Parameters:
        reportType - 上报类型
        code - 服务器返回 code
        finalType - 最终的协商结果
        finalToken - 最终协商的 token
      • onTokenReportResult

         void onTokenReportResult(PushType reportType, int code, PushType finalType, String finalToken, String message, Map<String, String> failMap)

        token 上报回调

        Parameters:
        reportType - 上报类型
        code - 服务器返回 code
        finalType - 最终的协商结果
        finalToken - 最终协商的 token
        message - 服务器返回 message
        failMap - 服务器返回 最终失败的 push 类型
      • onTokenReportResult

         void onTokenReportResult(PushType reportType, int code, PushType finalType, String finalToken, String message)

        token 上报回调

        Parameters:
        reportType - 上报类型
        code - 服务器返回 code
        finalType - 最终的协商结果
        finalToken - 最终协商的 token
        message - 服务器返回 message
      • onStartRegister

         void onStartRegister(List<PushType> preferTypes)

        开始注册推送

        Parameters:
        preferTypes - 注册的推送类型
      • onPreferPushType

         void onPreferPushType(List<PushType> preferType)

        获取到最合适推送类型回调

        Parameters:
        preferType - 最适推送类型
      • onGetTokenServer

         void onGetTokenServer(boolean isSuccess)

        获取 push token 上报服务器地址回调

        Parameters:
        isSuccess - 是否成功
      • onPushConfigInitFinish

         void onPushConfigInitFinish(Builder pushConfig)

        使用 Push 2.0 插件时解析的推送配置,如需修改请在此处修改

        Parameters:
        pushConfig - 推送配置
      • onGetTokenError

         void onGetTokenError(PushType pushType, long code, String errorMessage)

        获取 token 失败回调

        Parameters:
        pushType - 推送类型
        code - 错误码
        errorMessage - 错误信息
      • onStartTokenReport

         List<TokenBean> onStartTokenReport(List<TokenBean> tokenList)

        sdk 即将上报推送 token 时回调此方法,用户可以通过此接口,调整推送注册顺序,sdk会根据调整顺序上报

        Parameters:
        tokenList - sdk默认上报顺序,注册优先级,优先级高
        Returns:

        返回优先级