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) Callback before the notification is displayed.
      abstract void afterNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage) Callback triggered when a push notification delivery event is received from a third-party push platform.
      abstract boolean onNotificationMessageClicked(Context context, PushType pushType, PushNotificationMessage notificationMessage) Callback triggered when a notification is clicked.
      abstract void onThirdPartyPushState(PushType pushType, String action, long resultCode) Third-party push notification status callback
      abstract void onTokenReceived(PushType pushType, String token) Received Push Token Callback
      abstract void onTokenReportResult(PushType reportType, int code, PushType finalType, String finalToken) Token Reporting Callback
      void onTokenReportResult(PushType reportType, int code, PushType finalType, String finalToken, String message, Map<String, String> failMap) Token report callback
      void onTokenReportResult(PushType reportType, int code, PushType finalType, String finalToken, String message) Token Reporting Callback
      void onStartRegister(List<PushType> preferTypes) Starts push notification registration
      void onPreferPushType(List<PushType> preferType) Callback for obtaining the most suitable push notification type
      void onGetTokenServer(boolean isSuccess) Callback for obtaining the push token reporting server address
      void onPushConfigInitFinish(Builder pushConfig) Push configuration parsed when using the Push 2.0 plugin.
      void onGetTokenError(PushType pushType, long code, String errorMessage) Callback for failed token retrieval
      List<TokenBean> onStartTokenReport(List<TokenBean> tokenList) This method is called when the SDK is about to report the push token.
      • 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)

        Callback before the notification is displayed. Users can intercept this event to customize the notification display. This method is called back for RCdefault push, Huawei data transmission push, and FCM data push.

        Parameters:
        context - The context
        pushType - The push type
        notificationMessage - The push message
        Returns:

        Whether to intercept the event. `true` means the event is intercepted and the SDK will not handle it; `false` means the SDK will handle it with default logic.

      • afterNotificationMessageArrived

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

        Callback triggered when a push notification delivery event is received from a third-party push platform. At this point, the notification has already been displayed by the mobile platform and cannot be customized.

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

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

        Callback triggered when a notification is clicked.

        Parameters:
        context - The context
        pushType - The type of push notification
        notificationMessage - The push notification message
        Returns:

        Indicates whether the event is intercepted. true means the event is intercepted by the application layer, and the SDK will not process it; false means the event is processed according to the SDK's default logic.

      • onThirdPartyPushState

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

        Third-party push notification status callback

        Parameters:
        pushType - Push notification type
        action - Event
        resultCode - Error code
      • onTokenReceived

         abstract void onTokenReceived(PushType pushType, String token)

        Received Push Token Callback

        Parameters:
        pushType - Push notification type
        token - The received PushToken
      • onTokenReportResult

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

        Token Reporting Callback

        Parameters:
        reportType - Specifies the reporting type
        code - Indicates the server response code
        finalType - Represents the final negotiation result
        finalToken - Specifies the final negotiated token
      • onTokenReportResult

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

        Token report callback

        Parameters:
        reportType - Report type
        code - Server response code
        finalType - Final negotiation result
        finalToken - Final negotiated token
        message - Server response message
        failMap - Server response: types of push that ultimately failed
      • onTokenReportResult

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

        Token Reporting Callback

        Parameters:
        reportType - Specifies the type of report
        code - Indicates the code returned by the server
        finalType - Represents the final negotiation result
        finalToken - Specifies the final negotiated token
        message - Indicates the message returned by the server
      • onStartRegister

         void onStartRegister(List<PushType> preferTypes)

        Starts push notification registration

        Parameters:
        preferTypes - Specifies the types of push notifications to register
      • onPreferPushType

         void onPreferPushType(List<PushType> preferType)

        Callback for obtaining the most suitable push notification type

        Parameters:
        preferType - The most suitable push notification type
      • onGetTokenServer

         void onGetTokenServer(boolean isSuccess)

        Callback for obtaining the push token reporting server address

        Parameters:
        isSuccess - Indicates whether the operation was successful
      • onPushConfigInitFinish

         void onPushConfigInitFinish(Builder pushConfig)

        Push configuration parsed when using the Push 2.0 plugin. Modify here if needed.

        Parameters:
        pushConfig - Push configuration
      • onGetTokenError

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

        Callback for failed token retrieval

        Parameters:
        pushType - Push notification type
        code - Error code
        errorMessage - Error message
      • onStartTokenReport

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

        This method is called when the SDK is about to report the push token. Users can use this interface to adjust the order of push registration. The SDK will report based on the adjusted order.

        Parameters:
        tokenList - The default reporting order of the SDK, with higher priority tokens registered first.
        Returns:

        Returns the priority order.