Class PushConfig
-
- All Implemented Interfaces:
public final class PushConfigPush notification configuration for messages.
Customizes how remote push notifications are displayed and behaved.
Usage Example:
val pushConfig = PushConfig().apply { pushTitle = "New message" pushContent = "You received a message" pushData = "{\"key\":\"value\"}" iOSConfig = IOSPushConfig().apply { threadId = "chat_group_1" interruptionLevel = "time-sensitive" } androidConfig = AndroidPushConfig().apply { fcmChannelId = "chat_messages" } }
-
-
Field Summary
Fields Modifier and Type Field Description private BooleandisablePushTitleprivate StringpushTitleprivate StringpushContentprivate StringpushDataprivate BooleanforceShowDetailContentprivate StringtemplateIdprivate IOSPushConfigiOSConfigprivate AndroidPushConfigandroidConfig
-
Constructor Summary
Constructors Constructor Description PushConfig()
-
Method Summary
Modifier and Type Method Description final BooleangetDisablePushTitle()Whether to hide the push notification title. final UnitsetDisablePushTitle(Boolean disablePushTitle)Whether to hide the push notification title. final StringgetPushTitle()Push notification title. final UnitsetPushTitle(String pushTitle)Push notification title. final StringgetPushContent()Push notification content. final UnitsetPushContent(String pushContent)Push notification content. final StringgetPushData()Extra data attached to the push notification. final UnitsetPushData(String pushData)Extra data attached to the push notification. final BooleangetForceShowDetailContent()Whether to force showing notification detail content. final UnitsetForceShowDetailContent(Boolean forceShowDetailContent)Whether to force showing notification detail content. final StringgetTemplateId()Push template ID for localized push content. final UnitsetTemplateId(String templateId)Push template ID for localized push content. final IOSPushConfiggetIOSConfig()iOS platform push configuration. final UnitsetIOSConfig(IOSPushConfig iOSConfig)iOS platform push configuration. final AndroidPushConfiggetAndroidConfig()Android platform push configuration. final UnitsetAndroidConfig(AndroidPushConfig androidConfig)Android platform push configuration. StringtoString()-
-
Method Detail
-
getDisablePushTitle
final Boolean getDisablePushTitle()
Whether to hide the push notification title.
When true, the notification title is not displayed. Default is false.
-
setDisablePushTitle
final Unit setDisablePushTitle(Boolean disablePushTitle)
Whether to hide the push notification title.
When true, the notification title is not displayed. Default is false.
-
getPushTitle
final String getPushTitle()
Push notification title.
nulluses the default title.Default rule:
Built-in messages: Direct channels show sender name; group channels show group name.
Custom messages: No title by default.
-
setPushTitle
final Unit setPushTitle(String pushTitle)
Push notification title.
nulluses the default title.Default rule:
Built-in messages: Direct channels show sender name; group channels show group name.
Custom messages: No title by default.
-
getPushContent
final String getPushContent()
Push notification content.
nulluses the default content.Displayed in the notification bar when a remote push is delivered. For custom messages, this field must be set; otherwise the recipient may not receive a remote push. Built-in message types (e.g. TextMessage) have default push content.
-
setPushContent
final Unit setPushContent(String pushContent)
Push notification content.
nulluses the default content.Displayed in the notification bar when a remote push is delivered. For custom messages, this field must be set; otherwise the recipient may not receive a remote push. Built-in message types (e.g. TextMessage) have default push content.
-
getPushData
final String getPushData()
Extra data attached to the push notification.
nullmeans none.Additional information attached to the remote push. Retrievable from the push notification payload on the receiving end.
-
setPushData
final Unit setPushData(String pushData)
Extra data attached to the push notification.
nullmeans none.Additional information attached to the remote push. Retrievable from the push notification payload on the receiving end.
-
getForceShowDetailContent
final Boolean getForceShowDetailContent()
Whether to force showing notification detail content.
When the recipient has configured push to hide message details, this flag forces the notification to show the actual content. Default is false.
-
setForceShowDetailContent
final Unit setForceShowDetailContent(Boolean forceShowDetailContent)
Whether to force showing notification detail content.
When the recipient has configured push to hide message details, this flag forces the notification to show the actual content. Default is false.
-
getTemplateId
final String getTemplateId()
Push template ID for localized push content.
When set, the push content is matched by the recipient's language setting using a server-side template. If no match, the default content is used.
Note: pushTitle and pushContent take priority over the template.
-
setTemplateId
final Unit setTemplateId(String templateId)
Push template ID for localized push content.
When set, the push content is matched by the recipient's language setting using a server-side template. If no match, the default content is used.
Note: pushTitle and pushContent take priority over the template.
-
getIOSConfig
final IOSPushConfig getIOSConfig()
iOS platform push configuration.
-
setIOSConfig
final Unit setIOSConfig(IOSPushConfig iOSConfig)
iOS platform push configuration.
-
getAndroidConfig
final AndroidPushConfig getAndroidConfig()
Android platform push configuration.
-
setAndroidConfig
final Unit setAndroidConfig(AndroidPushConfig androidConfig)
Android platform push configuration.
-
toString
String toString()
-
-
-
-