Class PushNotificationMessage
-
- All Implemented Interfaces:
public class PushNotificationMessage
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumPushNotificationMessage.PushSourceType
-
Field Summary
Fields Modifier and Type Field Description public StringpushIdpublic RongPushClient.ConversationTypeconversationTypepublic longreceivedTimepublic StringobjectNamepublic StringsenderIdpublic StringsenderNamepublic UrisenderPortraitpublic StringtargetIdpublic StringtargetUserNamepublic StringtoIdpublic StringpushTitlepublic StringpushContentpublic StringpushDatapublic Stringextrapublic PushNotificationMessage.PushSourceTypesourceTypepublic Stringintentpublic intvoippublic StringnotificationIdpublic booleanisShowDetailpublic StringchannelIdMipublic StringchannelIdHWpublic StringchannelIdOPPOpublic StringchannelIdFCMpublic StringcollapseKeyFCMpublic StringimageUrlFCMpublic StringimageUrlHWpublic StringimageUrlMipublic StringbusChannelpublic Stringpidpublic final static Creator<PushNotificationMessage>CREATOR
-
Constructor Summary
Constructors Constructor Description PushNotificationMessage()
-
Method Summary
Modifier and Type Method Description StringgetPushId()获取标识该推送消息的唯一Id. voidsetPushId(String id)RongPushClient.ConversationTypegetConversationType()获取该推送消息所属的会话类型。比如单聊,群组,讨论组等。 voidsetConversationType(RongPushClient.ConversationType type)longgetReceivedTime()获取该推送消息的到达时间. voidsetReceivedTime(long time)StringgetObjectName()获取该推送消息的类型. voidsetObjectName(String objectName)StringgetSenderId()获取该推送消息的发送者Id。 voidsetSenderId(String id)StringgetSenderName()获取该推送消息的发送者名称。 voidsetSenderName(String name)UrigetSenderPortrait()获取该推送消息的发送者头像。 voidsetSenderPortrait(Uri uri)StringgetTargetId()获取该推送消息的目标Id. voidsetTargetId(String id)StringgetTargetUserName()获取该推送消息的目标名称. voidsetTargetUserName(String name)StringgetToId()获取推送的目标用户 id. voidsetToId(String id)StringgetPushTitle()推送标题。目前此字段没有启用。 voidsetPushTitle(String title)StringgetPushContent()获取推送通知的显示内容。 当该推送消息是自定义消息时,此处的值对应 sendMessage() 的参数 pushContent 的内容。如果您在发送自定义消息时, 没有填写 pushContent, 则收不到推送。 voidsetPushContent(String content)StringgetPushData()获取推送消息携带的附加信息。此处的值对应 sendMessage() 的参数 pushData 的内容。 使用场景:发送自定义消息时,如果在sendMessage()时填写参数pushData, 则收到这条消息的推送时,可以通过该方法获取 pushData 的内容。 voidsetPushData(String appDataContent)StringgetExtra()获取从开发者后台使用推送服务时,自定义的附加信息键值对。 该字段仅为开发者后台的推送服务使用,其余情况为null。 voidsetExtra(String extra)PushNotificationMessage.PushSourceTypegetSourceType()获取该推送的来源。PushSourceType voidsetSourceType(PushNotificationMessage.PushSourceType type)StringgetIntent()针对于华为和 FCM 的跳转意图 voidsetIntent(String intent)intgetVoip()voidsetVoip(int isVoip)StringgetNotificationId()voidsetNotificationId(String notificationId)booleanisShowDetail()voidsetShowDetail(boolean showDetail)StringgetChannelIdMi()voidsetChannelIdMi(String channelIdMi)StringgetChannelIdHW()voidsetChannelIdHW(String channelIdHW)StringgetChannelIdOPPO()voidsetChannelIdOPPO(String channelIdOPPO)StringgetChannelIdFCM()voidsetChannelIdFCM(String channelIdFCM)StringgetCollapseKeyFCM()voidsetCollapseKeyFCM(String collapseKeyFCM)StringgetImageUrlFCM()voidsetImageUrlFCM(String imageUrlFCM)StringgetImageUrlHW()voidsetImageUrlHW(String imageUrlHW)StringgetImageUrlMi()voidsetImageUrlMi(String imageUrlMi)StringgetBusChannel()voidsetBusChannel(String busChannel)StringgetPid()voidsetPid(String pid)voidsetPushFlag(String value)StringgetPushFlag()标识该消息是推送消息还是后台消息。 booleanisDisablePushTitle()intdescribeContents()voidwriteToParcel(Parcel dest, int flags)StringtoString()voidsetDisablePushTitle(boolean disablePushTitle)-
-
Method Detail
-
getPushId
String getPushId()
获取标识该推送消息的唯一Id. 当使用开发者后台的广播推送服务时,该Id用来追踪推送打开率。如果您自定义了推送通知的展示,在点击通知时需要调用 recordNotificationEvent 来上传推送打开事件,以便融云后台正确的帮您统计推送打开率。
- Returns:
当使用开发者后台的广播推送服务时, 返回符串为pushId,如果是消息转push时,则代表的是消息的uid。
-
setPushId
void setPushId(String id)
-
getConversationType
RongPushClient.ConversationType getConversationType()
获取该推送消息所属的会话类型。比如单聊,群组,讨论组等。
-
setConversationType
void setConversationType(RongPushClient.ConversationType type)
-
getReceivedTime
long getReceivedTime()
获取该推送消息的到达时间. 该时间是此条消息到达融云服务器的时间。
-
setReceivedTime
void setReceivedTime(long time)
-
getObjectName
String getObjectName()
获取该推送消息的类型. 比如文本消息为“RC:TxtMsg”,图片消息为“RC:ImgMsg”,语音消息为“RC:VcMsg”,或者如果是自定义消息, 则此处对应自定义消息的注解MessageTag里value的值。
-
setObjectName
void setObjectName(String objectName)
-
getSenderId
String getSenderId()
获取该推送消息的发送者Id。
-
setSenderId
void setSenderId(String id)
-
getSenderName
String getSenderName()
获取该推送消息的发送者名称。
-
setSenderName
void setSenderName(String name)
-
getSenderPortrait
Uri getSenderPortrait()
获取该推送消息的发送者头像。
-
setSenderPortrait
void setSenderPortrait(Uri uri)
-
getTargetId
String getTargetId()
获取该推送消息的目标Id. 如该推送发给 A 用户的 123 群组, 则这里返回群 123 的 id.
- Returns:
该推送消息的目标Id. 比如单聊时,是对方的id; 群组时,是群id.
-
setTargetId
void setTargetId(String id)
-
getTargetUserName
String getTargetUserName()
获取该推送消息的目标名称. 如该推送发给 A 用户的 123 群组, 则这里返回群 123 的名称.
- Returns:
该推送消息的目标名称. 比如单聊时,是对方的名称; 群组时,是群名称.
-
setTargetUserName
void setTargetUserName(String name)
-
getToId
String getToId()
获取推送的目标用户 id. 如这条推送发给 A 用户的 123 群组, 则这里返回用户 A 的 id.
- Returns:
获取推送的目标用户 id.
-
setToId
void setToId(String id)
-
getPushTitle
String getPushTitle()
推送标题。目前此字段没有启用。
-
setPushTitle
void setPushTitle(String title)
-
getPushContent
String getPushContent()
获取推送通知的显示内容。 当该推送消息是自定义消息时,此处的值对应 sendMessage() 的参数 pushContent 的内容。如果您在发送自定义消息时, 没有填写 pushContent, 则收不到推送。
-
setPushContent
void setPushContent(String content)
-
getPushData
String getPushData()
获取推送消息携带的附加信息。此处的值对应 sendMessage() 的参数 pushData 的内容。 使用场景:发送自定义消息时,如果在sendMessage()时填写参数pushData, 则收到这条消息的推送时,可以通过该方法获取 pushData 的内容。
-
setPushData
void setPushData(String appDataContent)
-
getExtra
String getExtra()
获取从开发者后台使用推送服务时,自定义的附加信息键值对。 该字段仅为开发者后台的推送服务使用,其余情况为null。
-
setExtra
void setExtra(String extra)
-
getSourceType
PushNotificationMessage.PushSourceType getSourceType()
获取该推送的来源。PushSourceType
- Returns:
推送来源。
-
setSourceType
void setSourceType(PushNotificationMessage.PushSourceType type)
-
getIntent
String getIntent()
针对于华为和 FCM 的跳转意图
-
setIntent
void setIntent(String intent)
-
getVoip
int getVoip()
-
setVoip
void setVoip(int isVoip)
-
getNotificationId
String getNotificationId()
-
setNotificationId
void setNotificationId(String notificationId)
-
isShowDetail
boolean isShowDetail()
-
setShowDetail
void setShowDetail(boolean showDetail)
-
getChannelIdMi
String getChannelIdMi()
-
setChannelIdMi
void setChannelIdMi(String channelIdMi)
-
getChannelIdHW
String getChannelIdHW()
-
setChannelIdHW
void setChannelIdHW(String channelIdHW)
-
getChannelIdOPPO
String getChannelIdOPPO()
-
setChannelIdOPPO
void setChannelIdOPPO(String channelIdOPPO)
-
getChannelIdFCM
String getChannelIdFCM()
-
setChannelIdFCM
void setChannelIdFCM(String channelIdFCM)
-
getCollapseKeyFCM
String getCollapseKeyFCM()
-
setCollapseKeyFCM
void setCollapseKeyFCM(String collapseKeyFCM)
-
getImageUrlFCM
String getImageUrlFCM()
-
setImageUrlFCM
void setImageUrlFCM(String imageUrlFCM)
-
getImageUrlHW
String getImageUrlHW()
-
setImageUrlHW
void setImageUrlHW(String imageUrlHW)
-
getImageUrlMi
String getImageUrlMi()
-
setImageUrlMi
void setImageUrlMi(String imageUrlMi)
-
getBusChannel
String getBusChannel()
-
setBusChannel
void setBusChannel(String busChannel)
-
getPid
String getPid()
-
setPid
void setPid(String pid)
-
setPushFlag
void setPushFlag(String value)
-
getPushFlag
String getPushFlag()
标识该消息是推送消息还是后台消息。
-
isDisablePushTitle
boolean isDisablePushTitle()
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
toString
String toString()
-
setDisablePushTitle
void setDisablePushTitle(boolean disablePushTitle)
-
-
-
-