Package io.rong.push

Class PushManager

  • All Implemented Interfaces:

    
    public class PushManager
    
                        

    用来进行推送初始化配置的主要管理类

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      PushConfig getPushConfig()
      long getConfigId()
      PushType getServerPushType()
      static PushManager getInstance()
      void init(Context context, PushConfig pushConfig)
      void onReceiveToken(Context context, PushType pushType, String token) 接受到第三方推送平台返回的 token 信息。
      void onReceiveToken(Context context, PushType pushType, String token, String area) 接受到第三方推送平台返回的 token 信息。
      void onReceiveToken(Context context, PushType pushType, String token, String area, boolean internal)
      void onSuccessResponse(Context context, PushType pushType) 配置成功的处理
      void onNetworkChangeEvent(Context context) 网络变化重新配置事件
      void registerRong(Context context, PushType pushType) 根据推送类型调用对应平台的注册接口进行注册.
      void onErrorResponse(Context context, PushType pushType, String action, long resultCode) 向第三方平台请求 token 时失败事件处理
      void onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage pushNotificationMessage) 推送通知到达的事件回调.
      void onNotificationMessageClicked(Context context, Intent pushIntent, PushType pushType, PushNotificationMessage pushNotificationMessage) 推送通知被点击时回调 融云自建通道的推送点击事件不会触发到这里,因为需要跨进程通信, 直接通过广播接收器进行接受处理
      void onPushRawData(Context context, PushType pushType, String data) 收到透传的消息数据
      void updatePushServerInfoFromToken(String token)
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • init

         void init(Context context, PushConfig pushConfig)
      • onReceiveToken

         void onReceiveToken(Context context, PushType pushType, String token)

        接受到第三方推送平台返回的 token 信息。

        Parameters:
        context - 上下文
        pushType - 推送类型
        token - 第三方推送平台返回的 token 信息。
      • onReceiveToken

         void onReceiveToken(Context context, PushType pushType, String token, String area)

        接受到第三方推送平台返回的 token 信息。

        Parameters:
        context - 上下文
        pushType - 推送类型
        token - 第三方推送平台返回的 token 信息。
      • onReceiveToken

         void onReceiveToken(Context context, PushType pushType, String token, String area, boolean internal)
      • onSuccessResponse

         void onSuccessResponse(Context context, PushType pushType)

        配置成功的处理

      • onNetworkChangeEvent

         void onNetworkChangeEvent(Context context)

        网络变化重新配置事件

        Parameters:
        context - 上下文
      • registerRong

         void registerRong(Context context, PushType pushType)

        根据推送类型调用对应平台的注册接口进行注册.

        Parameters:
        pushType - 推送类型
      • onErrorResponse

         void onErrorResponse(Context context, PushType pushType, String action, long resultCode)

        向第三方平台请求 token 时失败事件处理

        Parameters:
        context - 上下文
        pushType - 推送类型
        action - 此错误对应的行为
        resultCode - 第三方平台返回的错误码
      • onNotificationMessageArrived

         void onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage pushNotificationMessage)

        推送通知到达的事件回调. 使用第三方通知栏方式推送时,由手机系统层弹出通知后,再回调此事件。

        回调此方法时,通知栏已经弹出,故无法自定义通知的显示

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

         void onNotificationMessageClicked(Context context, Intent pushIntent, PushType pushType, PushNotificationMessage pushNotificationMessage)

        推送通知被点击时回调

        融云自建通道的推送点击事件不会触发到这里,因为需要跨进程通信, 直接通过广播接收器进行接受处理

        Parameters:
        context - 上下文
        pushType - 推送类型
        pushNotificationMessage - 通知消息
      • onPushRawData

         void onPushRawData(Context context, PushType pushType, String data)

        收到透传的消息数据