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

The sample demonstrating using various features of UTNotifications. More...

Inheritance diagram for UTNotifications.UTNotificationsSample:

Public Member Functions

void Initialize ()
 Initializes UTNotifications.Manager. You must always initialize it before accessing any UTNotifications' methods.

See also
UTNotifications.Manager.Initialize, UTNotifications.Manager.SetBadge
More...
 
void NotifyAll ()
 Requests UTNotifications DemoServer to push a user defined notification to all its registered devices. More...
 
IEnumerator NotifyAll (string title, string text, int id, string notificationProfile, int badgeNumber)
 Sends a "notify" request to DemoServer to push a specified notification to all its registered devices. See also Assets/UTNotifications/Editor/DemoServer/src/main/java/com/universal_tools/demoserver/PushNotificator.java. More...
 
void CreateLocalNotification ()
 Immediately posts a user defined notification.

See also
UTNotifications.Manager.PostLocalNotification
More...
 
void ScheduleLocalNotification ()
 Schedules the system to post a user defined notification in 30 seconds once. <seealso cref="UTNotifications.Manager.ScheduleNotification More...
 
void ScheduleRepeatingLocalNotification ()
 Schedules the system to post a user defined notification in 10 seconds and then show it every 25 seconds until it's cancelled.

See also
UTNotifications.Manager.ScheduleNotificationRepeating
More...
 
void Hide (int id)
 Hides the notification with the specified ID (ignored if the specified notification is not found).

See also
UTNotifications.Manager.HideNotification
More...
 
void Cancel (int id)
 Cancels the notification with the specified ID (ignored if the specified notification is not found).

See also
UTNotifications.Manager.CancelNotification
More...
 
void CancelAll ()
 Cancels all the notifiations of the app and resets the app icon badge.

See also
UTNotifications.Manager.CancelAllNotifications, UTNotifications.Manager.SetBadge
More...
 
void IncrementBadge ()
 Increments the app icon badge number, if supported by the target platform.

See also
UTNotifications.Manager.SetBadge, UTNotifications.Manager.GetBadge
More...
 
void OnNotificationsEnabledToggleValueChanged (bool value)
 Enables or disables showing notifications.

See also
UTNotifications.Manager.SetNotificationsEnabled, UTNotifications.Manager.NotificationsEnabled
More...
 

Public Attributes

ValidatedInputField DemoServerURLInputField
 
Text NotifyAllText
 
Text InitializeText
 
Toggle NotificationsEnabledToggle
 
CreateNotificationDialog CreateNotificationDialog
 
NotificationDetailsDialog NotificationDetailsDialog
 

Protected Member Functions

Dictionary< string, string > UserData (bool hasImage)
 Generates a sample user data dictionary, which optionally might define an image to be shown in an Android notification. More...
 
List< ButtonButtons (bool hasButtons)
 Optionally generates Android notification buttons. More...
 
void SendRegistrationId (string providerName, string registrationId)
 A wrapper for coroutine SendRegistrationId(string userId, string providerName, string registrationId).

See also
UTNotifications.Manager.OnSendRegistrationId
More...
 
IEnumerator SendRegistrationId (string userId, string providerName, string registrationId)
 Sends the unique device push notifications registrationId to DemoServer in a coroutine. See also Assets/UTNotifications/Editor/DemoServer/src/main/java/com/universal_tools/demoserver/Registrator.java. More...
 
void OnNotificationClicked (ReceivedNotification notification)
 Handles notification clicks (both cases: when the app was running or shut down).

See also
UTNotifications.Manager.OnNotificationClicked
More...
 
void OnNotificationsReceived (IList< ReceivedNotification > receivedNotifications)
 Handles one or more received/shown notifications (both cases: when the app was running or shut down).

See also
UTNotifications.Manager.OnNotificationsReceived
More...
 

Properties

static UTNotificationsSample Instance [get]
 The only (singleton) instance of UTNotificationsSample. More...
 

Detailed Description

The sample demonstrating using various features of UTNotifications.

Member Function Documentation

◆ Buttons()

List<Button> UTNotifications.UTNotificationsSample.Buttons ( bool  hasButtons)
protected

Optionally generates Android notification buttons.

◆ Cancel()

void UTNotifications.UTNotificationsSample.Cancel ( int  id)

Cancels the notification with the specified ID (ignored if the specified notification is not found).

See also
UTNotifications.Manager.CancelNotification

If the specified notification is scheduled or repeating all the future shows will be also canceled.

Parameters
idID of the notification to cancel.

◆ CancelAll()

void UTNotifications.UTNotificationsSample.CancelAll ( )

Cancels all the notifiations of the app and resets the app icon badge.

See also
UTNotifications.Manager.CancelAllNotifications, UTNotifications.Manager.SetBadge

◆ CreateLocalNotification()

void UTNotifications.UTNotificationsSample.CreateLocalNotification ( )

Immediately posts a user defined notification.

See also
UTNotifications.Manager.PostLocalNotification

Please note, that with the default settings, you can't see any notifications while the app is running in foreground. It can be changed for Android in UTNotifications settings.

◆ Hide()

void UTNotifications.UTNotificationsSample.Hide ( int  id)

Hides the notification with the specified ID (ignored if the specified notification is not found).

See also
UTNotifications.Manager.HideNotification

If the specified notification is scheduled or repeating, all the future shows will remain scheduled. Not supported and will be ignored on Windows Store/Universal Windows Platform.

Parameters
idID of the notification to hide.

◆ IncrementBadge()

void UTNotifications.UTNotificationsSample.IncrementBadge ( )

Increments the app icon badge number, if supported by the target platform.

See also
UTNotifications.Manager.SetBadge, UTNotifications.Manager.GetBadge

◆ Initialize()

void UTNotifications.UTNotificationsSample.Initialize ( )

Initializes UTNotifications.Manager. You must always initialize it before accessing any UTNotifications' methods.

See also
UTNotifications.Manager.Initialize, UTNotifications.Manager.SetBadge

◆ NotifyAll() [1/2]

void UTNotifications.UTNotificationsSample.NotifyAll ( )

Requests UTNotifications DemoServer to push a user defined notification to all its registered devices.

◆ NotifyAll() [2/2]

IEnumerator UTNotifications.UTNotificationsSample.NotifyAll ( string  title,
string  text,
int  id,
string  notificationProfile,
int  badgeNumber 
)

Sends a "notify" request to DemoServer to push a specified notification to all its registered devices. See also Assets/UTNotifications/Editor/DemoServer/src/main/java/com/universal_tools/demoserver/PushNotificator.java.

Parameters
titleNotification title
textNotification text
idThe notification ID (any notifications with the same id will be replaced by this one).
See also
UTNotifications.Manager.CancelNotification, UTNotifications.Manager.HideNotification
notificationProfile(Optional) The name of the notification profile (sound, icon and other notification attributes).
badgeNumber(Optional) The badge number, to be displayed on top of application icon, when supported. Use -1 (default) to keep previous value, 0 to hide the badge.
Returns
IEnumerator to be run as a coroutine.

◆ OnNotificationClicked()

void UTNotifications.UTNotificationsSample.OnNotificationClicked ( ReceivedNotification  notification)
protected

Handles notification clicks (both cases: when the app was running or shut down).

See also
UTNotifications.Manager.OnNotificationClicked

Parameters
notificationReceivedNotification that was clicked.

◆ OnNotificationsEnabledToggleValueChanged()

void UTNotifications.UTNotificationsSample.OnNotificationsEnabledToggleValueChanged ( bool  value)

Enables or disables showing notifications.

See also
UTNotifications.Manager.SetNotificationsEnabled, UTNotifications.Manager.NotificationsEnabled

Parameters
valueWhether notifications are allowed to be shown.

◆ OnNotificationsReceived()

void UTNotifications.UTNotificationsSample.OnNotificationsReceived ( IList< ReceivedNotification receivedNotifications)
protected

Handles one or more received/shown notifications (both cases: when the app was running or shut down).

See also
UTNotifications.Manager.OnNotificationsReceived

Parameters
receivedNotificationsList of ReceivedNotification that were received.

◆ ScheduleLocalNotification()

void UTNotifications.UTNotificationsSample.ScheduleLocalNotification ( )

Schedules the system to post a user defined notification in 30 seconds once. <seealso cref="UTNotifications.Manager.ScheduleNotification

Please note, that with the default settings, you can't see any notifications while the app is running in foreground. It can be changed for Android in UTNotifications settings.

◆ ScheduleRepeatingLocalNotification()

void UTNotifications.UTNotificationsSample.ScheduleRepeatingLocalNotification ( )

Schedules the system to post a user defined notification in 10 seconds and then show it every 25 seconds until it's cancelled.

See also
UTNotifications.Manager.ScheduleNotificationRepeating

Please note, that with the default settings, you can't see any notifications while the app is running in foreground. It can be changed for Android in UTNotifications settings.

◆ SendRegistrationId() [1/2]

void UTNotifications.UTNotificationsSample.SendRegistrationId ( string  providerName,
string  registrationId 
)
protected

◆ SendRegistrationId() [2/2]

IEnumerator UTNotifications.UTNotificationsSample.SendRegistrationId ( string  userId,
string  providerName,
string  registrationId 
)
protected

Sends the unique device push notifications registrationId to DemoServer in a coroutine. See also Assets/UTNotifications/Editor/DemoServer/src/main/java/com/universal_tools/demoserver/Registrator.java.

◆ UserData()

Dictionary<string, string> UTNotifications.UTNotificationsSample.UserData ( bool  hasImage)
protected

Generates a sample user data dictionary, which optionally might define an image to be shown in an Android notification.

Property Documentation

◆ Instance

UTNotificationsSample UTNotifications.UTNotificationsSample.Instance
staticget

The only (singleton) instance of UTNotificationsSample.


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