UTNotifications  1.8
Professional Local & Push Notification Plugin
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
UTNotifications.Notification Class Reference

Abstract base class for any notification type: immediate, scheduled, scheduled repeating or push. More...

Inheritance diagram for UTNotifications.Notification:
UTNotifications.LocalNotification UTNotifications.PushNotification UTNotifications.ScheduledNotification UTNotifications.ScheduledRepeatingNotification

Public Member Functions

 Notification (string title, string text, int id)
 Initializes a new instance of the T:UTNotifications.Notification class. More...
 
 Notification (string title, string text, int id, IDictionary< string, string > userData, string notificationProfile, int badgeNumber, ICollection< Button > buttons)
 Initializes a new instance of the T:UTNotifications.Notification class. More...
 
 Notification (JSONNode json)
 Initializes a new instance of the T:UTNotifications.Notification class. More...
 
virtual JSONClass ToJson ()
 Converts to a notification json. More...
 
Notification SetUserData (IDictionary< string, string > userData)
 Sets the user data. More...
 
Notification SetNotificationProfile (string notificationProfile)
 Sets the notification profile. More...
 
Notification SetBadgeNumber (int badgeNumber)
 Sets the badge number. More...
 
Notification SetButtons (ICollection< Button > buttons)
 Sets the buttons. More...
 
override string ToString ()
 Returns a T:System.String that represents the current T:UTNotifications.Notification. More...
 

Static Public Member Functions

static Notification FromJson (JSONNode json)
 Factory method to create a T:UTNotifications.Notification object from a notification json. More...
 

Public Attributes

const int BADGE_NOT_SPECIFIED = -1
 Use instead of a badge number to keep the previous badge number. More...
 
readonly string title
 The title. More...
 
readonly string text
 The text. More...
 
readonly int id
 The id. More...
 

Properties

IDictionary< string, string > userData [get]
 The user data provided by you in Manager.PostLocalNotification, Manager.ScheduleNotification or Manager.ScheduleNotificationRepeating or by your server in a push notification payload. More...
 
string notificationProfile [get]
 The name of the notification profile (sound, icon and other notification attributes). More...
 
int badgeNumber [get]
 The badge number (default value is BADGE_NOT_SPECIFIED). More...
 
ICollection< Buttonbuttons [get]
 Notification buttons (when supported by the platform). More...
 

Detailed Description

Abstract base class for any notification type: immediate, scheduled, scheduled repeating or push.

Constructor & Destructor Documentation

◆ Notification() [1/3]

UTNotifications.Notification.Notification ( string  title,
string  text,
int  id 
)

Initializes a new instance of the T:UTNotifications.Notification class.

Parameters
titleTitle.
textText.
idId.

◆ Notification() [2/3]

UTNotifications.Notification.Notification ( string  title,
string  text,
int  id,
IDictionary< string, string >  userData,
string  notificationProfile,
int  badgeNumber,
ICollection< Button buttons 
)

Initializes a new instance of the T:UTNotifications.Notification class.

Parameters
titleTitle.
textText.
idId.
userDataUser data (optional).
notificationProfileNotification profile (optional).
badgeNumberBadge number.
buttonsButtons (optional).

◆ Notification() [3/3]

UTNotifications.Notification.Notification ( JSONNode  json)

Initializes a new instance of the T:UTNotifications.Notification class.

Parameters
jsonNotification json.

Member Function Documentation

◆ FromJson()

static Notification UTNotifications.Notification.FromJson ( JSONNode  json)
static

Factory method to create a T:UTNotifications.Notification object from a notification json.

Returns
Notification.
Parameters
jsonNotification json.

◆ SetBadgeNumber()

Notification UTNotifications.Notification.SetBadgeNumber ( int  badgeNumber)

Sets the badge number.

Returns
this.
Parameters
badgeNumberBadge number.

◆ SetButtons()

Notification UTNotifications.Notification.SetButtons ( ICollection< Button buttons)

Sets the buttons.

Returns
this.
Parameters
buttonsButtons.

◆ SetNotificationProfile()

Notification UTNotifications.Notification.SetNotificationProfile ( string  notificationProfile)

Sets the notification profile.

Returns
this.
Parameters
notificationProfileNotification profile.

◆ SetUserData()

Notification UTNotifications.Notification.SetUserData ( IDictionary< string, string >  userData)

Sets the user data.

Returns
this.
Parameters
userDataUser data.

◆ ToJson()

virtual JSONClass UTNotifications.Notification.ToJson ( )
virtual

Converts to a notification json.

Returns
The json.

Reimplemented in UTNotifications.ScheduledRepeatingNotification, UTNotifications.ScheduledNotification, and UTNotifications.PushNotification.

◆ ToString()

override string UTNotifications.Notification.ToString ( )

Returns a T:System.String that represents the current T:UTNotifications.Notification.

Returns
A T:System.String that represents the current T:UTNotifications.Notification.

Member Data Documentation

◆ BADGE_NOT_SPECIFIED

const int UTNotifications.Notification.BADGE_NOT_SPECIFIED = -1

Use instead of a badge number to keep the previous badge number.

◆ id

readonly int UTNotifications.Notification.id

The id.

◆ text

readonly string UTNotifications.Notification.text

The text.

◆ title

readonly string UTNotifications.Notification.title

The title.

Property Documentation

◆ badgeNumber

int UTNotifications.Notification.badgeNumber
get

The badge number (default value is BADGE_NOT_SPECIFIED).

◆ buttons

ICollection<Button> UTNotifications.Notification.buttons
get

Notification buttons (when supported by the platform).

◆ notificationProfile

string UTNotifications.Notification.notificationProfile
get

The name of the notification profile (sound, icon and other notification attributes).

◆ userData

IDictionary<string, string> UTNotifications.Notification.userData
get

The user data provided by you in Manager.PostLocalNotification, Manager.ScheduleNotification or Manager.ScheduleNotificationRepeating or by your server in a push notification payload.

When the ReceivedNotification is an argument of Manager.OnNotificationClicked event handler, stores the user data of the clicked notification button (if specified). When the notification itself is clicked (even when there are custom buttons), stores the user data of the notification itself.


The documentation for this class was generated from the following file: