Class PushNotificationMessage

    • Constructor Detail

      • PushNotificationMessage

        PushNotificationMessage()
    • Method Detail

      • getPushId

         String getPushId()

        Retrieves the unique ID that identifies this push notification. When using the broadcast push service from the developer console, this ID is used to track the push open rate. If you customize the display of push notifications, you must call recordNotificationEvent to upload the push open event when the notification is clicked. This ensures that RCbackend can accurately calculate the push open rate for you.

        Returns:

        When using the broadcast push service from the developer console, returns a string representing the pushId. If the push is converted from a message, it represents the message's UID.

      • getReceivedTime

         long getReceivedTime()

        Get the arrival time of the push notification. This time indicates when the message arrived at the RCserver.

      • getObjectName

         String getObjectName()

        Get the type of the push notification. For example, RC:TxtMsg for text messages, RC:ImgMsg for image messages, RC:VcMsg for voice messages. If it is a custom message, the value corresponds to the `value` in the `MessageTag` annotation of the custom message.

      • getSenderId

         String getSenderId()

        Retrieves the sender ID of the push notification.

      • getSenderName

         String getSenderName()

        Retrieves the sender's name of the push notification.

      • getSenderPortrait

         Uri getSenderPortrait()

        Retrieves the sender's avatar for this push notification.

      • getTargetId

         String getTargetId()

        Retrieves the target ID of the push notification. For example, if the push is sent to group 123 of user A, the ID of group 123 is returned here.

        Returns:

        The target ID of the push notification. For one-to-one chat, it is the ID of the other user; for group chat, it is the group ID.

      • getTargetUserName

         String getTargetUserName()

        Retrieves the target name of the push notification. For example, if the push is sent to group 123 of user A, the name of group 123 is returned here.

        Returns:

        The target name of the push notification. For instance, in a one-to-one chat, it is the name of the other party; in a group chat, it is the group name.

      • getToId

         String getToId()

        Retrieves the target user ID for the push notification. For example, if this push notification is sent to user A's group 123, it returns the ID of user A.

        Returns:

        The target user ID for the push notification.

      • getPushTitle

         String getPushTitle()

        Push Notification Title.** Currently, this field is not enabled.

      • getPushContent

         String getPushContent()

        Retrieves the display content of the push notification. When the push message is a custom message, this value corresponds to the content of the `pushContent` parameter in `sendMessage()`. If `pushContent` is not provided when sending a custom message, no push notification will be received.

      • getPushData

         String getPushData()

        Retrieves the additional information carried by the push notification. The value here corresponds to the content of the `pushData` parameter in `sendMessage()`. Usage scenario: When sending a custom message, if the `pushData` parameter is filled in `sendMessage()`, the content of `pushData` can be retrieved through this method when the push notification for this message is received.

      • getExtra

         String getExtra()

        Retrieves the key-value pairs of custom additional information when using the push notification service from the developer console. This field is exclusively used for the push notification service in the developer console and is null in all other cases.

      • getIntent

         String getIntent()

        For Huawei and FCM redirection intent

      • setVoip

         void setVoip(int isVoip)
      • setPid

         void setPid(String pid)
      • getPushFlag

         String getPushFlag()

        Indicates whether the message is a push notification or a background message.