public class CustomNotification
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
CustomNotification() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getApnsText()
get the content of a message pushed over APNS on iOS devices.
|
CustomNotificationConfig |
getConfig() |
java.lang.String |
getContent()
Get the content of a message
|
java.lang.String |
getEnv()
Get the environment variable
Used to point to different types of configurations for message delivery and third-party callbacks.
|
java.lang.String |
getFromAccount()
Get the account that sent the notification
|
NIMAntiSpamOption |
getNIMAntiSpamOption()
Get the anti-spam configuration
|
java.util.Map<java.lang.String,java.lang.Object> |
getPushPayload()
Get the third-party push payload
|
java.lang.String |
getSessionId()
Get the session ID (peer account, group ID)
|
SessionTypeEnum |
getSessionType()
Get the session type
|
long |
getTime()
Get the time when the message was sent.
|
boolean |
isSendToOnlineUserOnly()
Specify whether the messaging is sent only to online users or groups.
|
void |
setApnsText(java.lang.String apnsText)
Set the content of a message pushed over APNS on iOS devices.
|
void |
setConfig(CustomNotificationConfig config) |
void |
setContent(java.lang.String content)
Set the content of a message
|
void |
setEnv(java.lang.String env)
Set the environment variable
Used to point to different types of configurations for message delivery and third-party callbacks.
|
void |
setFromAccount(java.lang.String fromAccount)
Get the sender account
|
void |
setNIMAntiSpamOption(NIMAntiSpamOption antiSpamOption)
Set anti-spam options
|
void |
setPushPayload(java.util.Map<java.lang.String,java.lang.Object> pushPayload)
Set the third-party push payload
|
void |
setSendToOnlineUserOnly(boolean sendToOnlineUserOnly)
Send messages only to online users
If the value is set to true, message can be received when the peer gets online. |
void |
setSessionId(java.lang.String sessionId)
Set the session ID
|
void |
setSessionType(SessionTypeEnum sessionType)
set the session type
|
void |
setTime(long time)
Set the time
|
JSONObject |
toJsonObj() |
public java.lang.String getSessionId()
public void setSessionId(java.lang.String sessionId)
sessionId
- Session IDpublic SessionTypeEnum getSessionType()
public void setSessionType(SessionTypeEnum sessionType)
sessionType
- Session typepublic java.lang.String getFromAccount()
public void setFromAccount(java.lang.String fromAccount)
fromAccount
- The sender accountpublic long getTime()
public void setTime(long time)
public java.lang.String getContent()
public void setContent(java.lang.String content)
public boolean isSendToOnlineUserOnly()
public void setSendToOnlineUserOnly(boolean sendToOnlineUserOnly)
sendToOnlineUserOnly
- Specify whether to send messages only to online users. SDK v4.1 and later supports offline custom group notifications.public java.lang.String getApnsText()
public void setApnsText(java.lang.String apnsText)
apnsText
- APNs push text settingpublic java.util.Map<java.lang.String,java.lang.Object> getPushPayload()
public void setPushPayload(java.util.Map<java.lang.String,java.lang.Object> pushPayload)
pushPayload
- Third party custom push payload. Make sure the payload can be converted into JsonObject. The maximum size of the content is 2048 bytes.public CustomNotificationConfig getConfig()
public void setConfig(CustomNotificationConfig config)
public NIMAntiSpamOption getNIMAntiSpamOption()
public void setNIMAntiSpamOption(NIMAntiSpamOption antiSpamOption)
antiSpamOption
- public java.lang.String getEnv()
public void setEnv(java.lang.String env)
env
- Environment variablepublic JSONObject toJsonObj()