java.lang.Object
com.vasco.digipass.sdk.utils.notification.server.Notification

public class Notification extends Object
The Notification object contains all the elements (title, subject...) to build a notification ready to be sent to the user device. It must be provided to the NotificationSDKServer.sendNotification(String, Notification) method.
  • Constructor Details

    • Notification

      public Notification(String title, String subject, String content, boolean isHighPriority)
      Creates a Notification object from its mandatory attributes.
      Parameters:
      title - text to be displayed as title of the notification. Must not be null. On iOS, the title must not contain any '\n' character
      subject - text to be displayed as subject of the notification. Must not be null.
      content - text to be used as content of the notification. Will be provided to the client application once the notification has been opened. Must not be null.
      isHighPriority - boolean to be used to set notification priority.
    • Notification

      public Notification(String title, String subject, String content)
      Creates a Notification object from its mandatory attributes.
      Parameters:
      title - text to be displayed as title of the notification. Must not be null. On iOS, the title must not contain any '\n' character
      subject - text to be displayed as subject of the notification. Must not be null.
      content - text to be used as content of the notification. Will be provided to the client application once the notification has been opened. Must not be null.
  • Method Details

    • getIdentifier

      public int getIdentifier()
      Gets the notification identifier of the notification.
      Returns:
      the notification identifier of the notification
    • setIdentifier

      public void setIdentifier(int identifier)
      Sets the notification identifier of the notification.
      Parameters:
      identifier - the notification identifier of the notification
    • getContent

      public String getContent()
      Gets the content of the notification.
      Returns:
      the content of the notification
    • setContent

      public void setContent(String content)
      Sets the content of the notification.
      Parameters:
      content - the content of the notification to set
    • getTitle

      public String getTitle()
      Gets the title of the notification.
      Returns:
      the title of the notification
    • setTitle

      public void setTitle(String title)
      Sets the title of the notification.
      Parameters:
      title - the title of the notification to set
    • getSubject

      public String getSubject()
      Gets the subject of the notification.
      Returns:
      the subject of the notification
    • getPriority

      public String getPriority()
      Gets the priority of the notification.
      Returns:
      the priority of the notification
    • setSubject

      public void setSubject(String subject)
      Sets the subject of the notification.
      Parameters:
      subject - the subject of the notification to set
    • addCustomAttribute

      public void addCustomAttribute(String key, String value)
      Adds a custom attributes to the notification.
      Parameters:
      key - the key of the attribute
      value - the value of the attribute
    • getCustomAttributes

      public Map<String,String> getCustomAttributes()
      Gets the tracking identifier used to differentiate the notifications in the error/success callbacks.
      Returns:
      the tracking identifier used to differentiate the notifications in the error/success callbacks
    • getTrackingIdentifier

      public int getTrackingIdentifier()
      Gets the tracking identifier used to differentiate the notifications in the error/success callbacks.
      Returns:
      the tracking identifier used to differentiate the notifications in the error/success callbacks
    • setTrackingIdentifier

      public void setTrackingIdentifier(int trackingIdentifier)
      Sets the tracking identifier used to differentiate the notifications in the error/success callbacks.
      Parameters:
      trackingIdentifier - the tracking identifier used to differentiate the notifications in the error/success callbacks
    • setIOSBadge

      public void setIOSBadge(int badge)
      (iOS only).

      Sets the notification badge to be displayed next to the application icon.

      If the badge value is negative, no badge will be sent in the notification, and the badge of the application icon (if there is one) will not be changed.

      If the badge value is 0, the notification badge will be removed.

      Default value is -1 (no badge sent).

      Parameters:
      badge - The number to display as the badge of the application icon
    • getIOSBadge

      public int getIOSBadge()
      (iOS only).

      Gets the notification badge to be displayed next to the application icon.

      Returns:
      the number to display as the badge of the application icon.
    • setAndroidHeadsUp

      public void setAndroidHeadsUp(boolean androidHeadsUp)
      (Android only).

      Sets the android notification to be heads-up.

      Parameters:
      androidHeadsUp - true to set the notification as heads-up.
    • isAndroidHeadsUp

      public boolean isAndroidHeadsUp()
      (Android only).

      Indicates if the android notification is heads-up or not.

      Returns:
      true if the notification is heads-up.
    • setiOSBundleId

      public void setiOSBundleId(String bundleId)
      (iOS only).

      Sets the bundle ID of the application targeted by the notification.

      Parameters:
      bundleId - the targeted application's bundle ID.
    • getiOSBundleId

      public String getiOSBundleId()
      (iOS only).

      Gets the bundle ID of the application targeted by the notification.

      Returns:
      the targeted application's bundle ID.
    • getTimeToLive

      public Date getTimeToLive()
      Gets the time to live of the notification.
      Returns:
      the time to live of the notification
    • setTimeToLive

      public void setTimeToLive(Date timeToLive)
      Sets the time to live of the notification.
      Parameters:
      timeToLive - the time to live of the notification
    • setAndroidDryRun

      public void setAndroidDryRun(boolean dryRun)
      (Android only).

      Sets the dry-run option of the call. Set to 1 in order to validate the notification on the server without sending it to the device.

      Parameters:
      dryRun - true to set the notification call as dry-run
    • isAndroidDryRun

      public boolean isAndroidDryRun()
      (Android only).

      Indicates if the notification call is dry-run or not.

      Returns:
      true if the notification call is dry-run.