Package im.getsocial.sdk.notifications
Class Notification
- java.lang.Object
-
- im.getsocial.sdk.notifications.Notification
-
public class Notification extends java.lang.Object
Entity of GetSocial Push Notification.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Notification.NotificationType
-
Constructor Summary
Constructors Constructor Description Notification(java.lang.String id, java.util.List<NotificationButton> actionButtons, java.lang.String status, java.lang.String type, long createdAt, java.lang.String title, java.lang.String text, Action action, MediaAttachment attachment, User sender, NotificationCustomization customization)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Action
getAction()
Action to be done on notification click.java.util.List<NotificationButton>
getActionButtons()
Return a list of buttons for this notification.MediaAttachment
getAttachment()
long
getCreatedAt()
Date of notification creation.NotificationCustomization
getCustomization()
Returns customization settings, like background image, title color, etc.java.lang.String
getId()
Get the unique notification identifier.User
getSender()
Returns the sender of notification.java.lang.String
getStatus()
Status of Notification.java.lang.String
getText()
Text of notification.java.lang.String
getTitle()
Title of notification.java.lang.String
getType()
One of the constants inNotification.NotificationType
.java.lang.String
toString()
boolean
wasRead()
Deprecated.usegetStatus()
.
-
-
-
Constructor Detail
-
Notification
public Notification(java.lang.String id, java.util.List<NotificationButton> actionButtons, java.lang.String status, java.lang.String type, long createdAt, java.lang.String title, java.lang.String text, Action action, MediaAttachment attachment, User sender, NotificationCustomization customization)
-
-
Method Detail
-
getTitle
public java.lang.String getTitle()
Title of notification.- Returns:
- title or empty string in case title is not present
-
getText
public java.lang.String getText()
Text of notification.- Returns:
- full text of push notification.
-
getAction
public Action getAction()
Action to be done on notification click.- Returns:
- one of
ActionTypes
.
-
getActionButtons
public java.util.List<NotificationButton> getActionButtons()
Return a list of buttons for this notification.- Returns:
- list of buttons to show with notification.
-
getId
public java.lang.String getId()
Get the unique notification identifier.- Returns:
- ID.
-
wasRead
public boolean wasRead()
Deprecated.usegetStatus()
.Return was notification read by user or not.- Returns:
- true, if notification was clicked by user or marked as read by developer.
-
getStatus
public java.lang.String getStatus()
Status of Notification. One ofNotificationStatus
.- Returns:
- notification status.
-
getType
public java.lang.String getType()
One of the constants inNotification.NotificationType
.- Returns:
- type of notification.
-
getCreatedAt
public long getCreatedAt()
Date of notification creation.- Returns:
- UNIX-timestamp of creation date in seconds.
-
getAttachment
public MediaAttachment getAttachment()
- Returns:
- media attachment, or null if nothing was attached.
-
getSender
public User getSender()
Returns the sender of notification.- Returns:
- sender or null.
-
getCustomization
public NotificationCustomization getCustomization()
Returns customization settings, like background image, title color, etc. Settings used only on Android.- Returns:
- sender or null.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-