public final class NotificationContent
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
NotificationContent |
addActionData(java.util.Map<java.lang.String,java.lang.String> actionData)
Add all keys and values from map to action data.
|
NotificationContent |
addActionData(java.lang.String key,
java.lang.String value)
Add action data you could retrieve on the receiver side.
|
NotificationContent |
addTemplatePlaceholder(java.lang.String placeholder,
java.lang.String replacement)
If you specified placeholders on the GetSocial Dashboard for your template title or text - you can replace it using this method.
|
NotificationContent |
addTemplatePlaceholders(java.util.Map<java.lang.String,java.lang.String> templateData)
Add all keys and values from map to template placeholders.
|
static NotificationContent |
notificationFromTemplate(java.lang.String templateName)
Create notification from the template configured on the GetSocial Dashboard.
|
static NotificationContent |
notificationWithText(java.lang.String text)
Create notification with text.
|
NotificationContent |
withAction(int actionType)
Set notification action to be performed on click.
|
NotificationContent |
withTemplateName(java.lang.String templateName)
Set template name.
|
NotificationContent |
withText(java.lang.String text)
Set notification text.
|
NotificationContent |
withTitle(java.lang.String title)
Set notification title.
|
public static NotificationContent notificationWithText(java.lang.String text)
text
- text to be displayed to receivers.public static NotificationContent notificationFromTemplate(java.lang.String templateName)
templateName
- name of the template on the GetSocial Dashboard. Case-sensitive.public NotificationContent withAction(int actionType)
Notification.ActionType
.
Default is Notification.ActionType.CUSTOM
.actionType
- what should be done when user clicks on notification.public NotificationContent addActionData(java.lang.String key, java.lang.String value)
Notification.Key
for default actions or pass your custom data.key
- action key.value
- action value.public NotificationContent addActionData(java.util.Map<java.lang.String,java.lang.String> actionData)
actionData
- map of action keys and values.public NotificationContent withTitle(java.lang.String title)
title
- notification title.public NotificationContent withText(java.lang.String text)
text
- notification text.public NotificationContent withTemplateName(java.lang.String templateName)
withTitle(String)
or withText(String)
have higher priority and will override template values.templateName
- name of the template on the dashboard. Case-sensitive.public NotificationContent addTemplatePlaceholder(java.lang.String placeholder, java.lang.String replacement)
placeholder
- placeholder on the GetSocial Dashboard.replacement
- actual text that should be used instead.public NotificationContent addTemplatePlaceholders(java.util.Map<java.lang.String,java.lang.String> templateData)
templateData
- template placeholders map.(c) Copyright GetSocial BV, 2018. All Rights Reserved.