Package io.rong.push

Class PushManager

  • All Implemented Interfaces:

    
    public class PushManager
    
                        

    The primary management class for push notification initialization configuration

    • 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) Receives the token information returned by the third-party push notification platform.
      void onReceiveToken(Context context, PushType pushType, String token, String area) Receives the token information returned by the third-party push notification platform.
      void onReceiveToken(Context context, PushType pushType, String token, String area, boolean internal)
      void onSuccessResponse(Context context, PushType pushType, List<TokenBean> tokenList, Map<String, String> failMap) Configuration successful handling
      void onNetworkChangeEvent(Context context) Network change reconfiguration event
      void registerRong(Context context, PushType pushType) Registers the corresponding platform's registration interface based on the push type.
      void onErrorResponse(Context context, PushType pushType, String action, long resultCode) Handling of failed token request to third-party platform event
      void onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage pushNotificationMessage) Callback triggered when a push notification is received.
      void onNotificationMessageClicked(Context context, Intent pushIntent, PushType pushType, PushNotificationMessage pushNotificationMessage) Callback triggered when a push notification is clicked Push click events from RongCloud's built-in channel will not trigger here due to cross-process communication.
      void onPushRawData(Context context, PushType pushType, String data) Receives transparently transmitted message 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)

        Receives the token information returned by the third-party push notification platform.

        Parameters:
        context - The context.
        pushType - The push notification type.
        token - The token information returned by the third-party push notification platform.
      • onReceiveToken

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

        Receives the token information returned by the third-party push notification platform.

        Parameters:
        context - The context.
        pushType - The push notification type.
        token - The token information returned by the third-party push notification platform.
      • onReceiveToken

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

         void onSuccessResponse(Context context, PushType pushType, List<TokenBean> tokenList, Map<String, String> failMap)

        Configuration successful handling

      • onNetworkChangeEvent

         void onNetworkChangeEvent(Context context)

        Network change reconfiguration event

        Parameters:
        context - The context
      • registerRong

         void registerRong(Context context, PushType pushType)

        Registers the corresponding platform's registration interface based on the push type.

        Parameters:
        pushType - The push type
      • onErrorResponse

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

        Handling of failed token request to third-party platform event

        Parameters:
        context - The context
        pushType - The push notification type
        action - The action corresponding to this error
        resultCode - The error code returned by the third-party platform
      • onNotificationMessageArrived

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

        Callback triggered when a push notification is received. When using third-party notification methods, this event is called after the notification is displayed by the mobile system layer.

        When this method is called, the notification has already been displayed, so it is not possible to customize the notification appearance.

        Parameters:
        context - The context
        pushType - The type of push notification
        pushNotificationMessage - The notification message
      • onNotificationMessageClicked

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

        Callback triggered when a push notification is clicked

        Push click events from RongCloud's built-in channel will not trigger here due to cross-process communication. They are directly handled by the broadcast receiver .

        Parameters:
        context - Context
        pushType - Push type
        pushNotificationMessage - Notification message
      • onPushRawData

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

        Receives transparently transmitted message data