Class NotificationContent


  • public final class NotificationContent
    extends java.lang.Object
    • Method Detail

      • notificationWithText

        public static NotificationContent notificationWithText​(java.lang.String text)
        Create notification with text.
        Parameters:
        text - text to be displayed to receivers.
        Returns:
        new notification content.
      • notificationFromTemplate

        public static NotificationContent notificationFromTemplate​(java.lang.String templateName)
        Create notification from the template configured on the GetSocial Dashboard.
        Parameters:
        templateName - name of the template on the GetSocial Dashboard. Case-sensitive.
        Returns:
        new notification content.
      • withAction

        public NotificationContent withAction​(Action action)
        Set a notification action.
        Parameters:
        action - notification action to perform.
        Returns:
        notification content for methods chaining.
      • withTitle

        public NotificationContent withTitle​(java.lang.String title)
        Set notification title. If you use template, your title will be overriden by this.
        Parameters:
        title - notification title.
        Returns:
        notification content for methods chaining.
      • withText

        public NotificationContent withText​(java.lang.String text)
        Set notification text. If you use template, your text will be overriden by this.
        Parameters:
        text - notification text.
        Returns:
        notification content for methods chaining.
      • withTemplateName

        public NotificationContent withTemplateName​(java.lang.String templateName)
        Set template name. Notification will use values from the GetSocial Dashboard as title and text. But withTitle(String) or withText(String) have higher priority and will override template values.
        Parameters:
        templateName - name of the template on the dashboard. Case-sensitive.
        Returns:
        notification content for methods chaining.
      • addTemplatePlaceholder

        public 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. For example, if your template text it "Hello, [USERNAME].", call notificationContent.addTemplatePlaceholder("USERNAME", "My actual name"). Brackets should be omitted in key. Won't make any effect without template name.
        Parameters:
        placeholder - placeholder on the GetSocial Dashboard.
        replacement - actual text that should be used instead.
        Returns:
        notification content for methods chaining.
      • addTemplatePlaceholders

        public NotificationContent addTemplatePlaceholders​(java.util.Map<java.lang.String,​java.lang.String> templateData)
        Add all keys and values from map to template placeholders.
        Parameters:
        templateData - template placeholders map.
        Returns:
        notification content for methods chaining.
      • withMediaAttachment

        public NotificationContent withMediaAttachment​(MediaAttachment mediaAttachment)
        Attach media(image, video) to notification.
        Parameters:
        mediaAttachment - media attachment.
        Returns:
        notification content for methods chaining.
      • addActionButton

        public NotificationContent addActionButton​(NotificationButton actionButton)
        Attach action button to notifications.
        Parameters:
        actionButton - action button to show.
        Returns:
        notification content for methods chaining.
      • addActionButtons

        public NotificationContent addActionButtons​(java.util.List<NotificationButton> actionButtons)
        Attach action buttons to notifications.
        Parameters:
        actionButtons - action button to show.
        Returns:
        notification content for methods chaining.
      • withCustomization

        public NotificationContent withCustomization​(NotificationCustomization customization)
        Customize notification, like change background image, title and text color. Supported only on Android.
        Parameters:
        customization - NotificationCustomization instance.
        Returns:
        notification content for methods chaining.
      • withBadge

        public NotificationContent withBadge​(NotificationContent.Badge badge)
        Update badge count. Supported only on iOS.
        Parameters:
        badge - badge modification.
        Returns:
        notification content for methods chaining.