Class Notification
NotificationSDKServer.sendNotification(String, Notification)
method.-
Constructor Summary
ConstructorsConstructorDescriptionNotification
(String title, String subject, String content) Creates aNotification
object from its mandatory attributes.Notification
(String title, String subject, String content, boolean isHighPriority) Creates aNotification
object from its mandatory attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCustomAttribute
(String key, String value) Adds a custom attributes to the notification.Gets the content of the notification.Gets the tracking identifier used to differentiate the notifications in the error/success callbacks.int
Gets the notification identifier of the notification.int
(iOS only).(iOS only).Gets the priority of the notification.Gets the subject of the notification.Gets the time to live of the notification.getTitle()
Gets the title of the notification.int
Gets the tracking identifier used to differentiate the notifications in the error/success callbacks.boolean
(Android only).boolean
(Android only).void
setAndroidDryRun
(boolean dryRun) (Android only).void
setAndroidHeadsUp
(boolean androidHeadsUp) (Android only).void
setContent
(String content) Sets the content of the notification.void
setIdentifier
(int identifier) Sets the notification identifier of the notification.void
setIOSBadge
(int badge) (iOS only).void
setiOSBundleId
(String bundleId) (iOS only).void
setSubject
(String subject) Sets the subject of the notification.void
setTimeToLive
(Date timeToLive) Sets the time to live of the notification.void
Sets the title of the notification.void
setTrackingIdentifier
(int trackingIdentifier) Sets the tracking identifier used to differentiate the notifications in the error/success callbacks.
-
Constructor Details
-
Notification
Creates aNotification
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' charactersubject
- 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
Creates aNotification
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' charactersubject
- 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
Gets the content of the notification.- Returns:
- the content of the notification
-
setContent
Sets the content of the notification.- Parameters:
content
- the content of the notification to set
-
getTitle
Gets the title of the notification.- Returns:
- the title of the notification
-
setTitle
Sets the title of the notification.- Parameters:
title
- the title of the notification to set
-
getSubject
Gets the subject of the notification.- Returns:
- the subject of the notification
-
getPriority
Gets the priority of the notification.- Returns:
- the priority of the notification
-
setSubject
Sets the subject of the notification.- Parameters:
subject
- the subject of the notification to set
-
addCustomAttribute
Adds a custom attributes to the notification.- Parameters:
key
- the key of the attributevalue
- the value of the attribute
-
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
(iOS only).Sets the bundle ID of the application targeted by the notification.
- Parameters:
bundleId
- the targeted application's bundle ID.
-
getiOSBundleId
(iOS only).Gets the bundle ID of the application targeted by the notification.
- Returns:
- the targeted application's bundle ID.
-
getTimeToLive
Gets the time to live of the notification.- Returns:
- the time to live of the notification
-
setTimeToLive
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.
-