Class Notification
Definition
- Namespace:
- Tizen.Applications.Notifications
- Assembly:
- Tizen.Applications.Notification.dll
- API Level:
- 3
This class contains common properties and methods of notifications.
C#Copypublic sealed class Notification : IDisposable
- Inheritance
-
Notification
- Implements
-
System.IDisposable
Remarks
A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.
Constructors
Declaration
C#Copypublic Notification()
API Level: 3
Properties
Accessory
Gets or sets Notification.AccessorySet which is included vibration, LED and sound option to be applied at notification.
Declaration
C#Copypublic Notification.AccessorySet Accessory { get; set; }
Property Value
Type | Description |
---|---|
Notification.AccessorySet |
Remarks
If you set it to null, the already set AccessorySet will be initialized.
Examples
CopyNotification notification = new Notification { Title = "Notification", Content = "Hello Tizen", Icon = "Icon path", Count = 3 }; Notification.AccessorySet accessory = new Notification.AccessorySet { SoundOption = AccessoryOption.Custom, SoundPath = "Sound File Path", IsVibration = true, LedOption = AccessoryOption.Custom, LedOnMs = 100; LedOffMs = 50; LedColor = Color.Lime }; notification.Accessory = accessory; NotificationManager.Post(notification);
API Level: 3
Declaration
C#Copypublic AppControl Action { get; set; }
Property Value
Type | Description |
---|---|
AppControl |
Remarks
If you set it to null, the already set AppControl will be removed and nothing will happen when you click on notification.
See Also
API Level: 3
Declaration
C#Copypublic string Content { get; set; }
Property Value
Type | Description |
---|---|
System.String |
API Level: 3
Declaration
C#Copypublic int Count { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
You must set only positive number. If you set count to negative number, this property throws exception.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
API Level: 3
Icon
Gets or sets the icon of notification. You should set an absolute path for an image file.
Declaration
C#Copypublic string Icon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
API Level: 3
IsTimeStampVisible
Gets or sets a value indicating whether TimeStamp of the notification is Visible or not. Default to true.
Declaration
C#Copypublic bool IsTimeStampVisible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: 3
IsVisible
Gets or sets a value indicating whether notification is displayed on the default viewer. If you set false and add style, you can see only style notification.
Declaration
C#Copypublic bool IsVisible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: 4
Declaration
C#Copypublic Notification.ProgressType Progress { get; set; }
Property Value
Type | Description |
---|---|
Notification.ProgressType |
See Also
API Level: 3
Declaration
C#Copypublic NotificationProperty Property { get; set; }
Property Value
Type | Description |
---|---|
NotificationProperty |
See Also
API Level: 3
SubIcon
Gets or sets the sub icon of notification. This SubIcon is displayed in Icon you set. You should set an absolute path for an image file.
Declaration
C#Copypublic string SubIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
API Level: 3
Declaration
C#Copypublic string Tag { get; set; }
Property Value
Type | Description |
---|---|
System.String |
API Level: 3
Declaration
C#Copypublic DateTime TimeStamp { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
Remarks
If you don't set TimeStamp, it will set the value when the notification is posted. TimeStamp requires NotificationManager.Post() to be called. If you set IsVisibleTimeStamp property to false, TimeStamp is not visible in notification.
API Level: 3
Declaration
C#Copypublic string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String |
API Level: 3
Methods
AddStyle(Notification.StyleBase)
Method for adding various styles to be applied to notification.
Declaration
C#Copypublic void AddStyle(Notification.StyleBase style)
Parameters
Type | Name | Description |
---|---|---|
Notification.StyleBase | style | The style to be applied to notification. |
Remarks
The user always see about valid notification style. If you add a style which is not supported in platform, this method has no effect.
Examples
CopyNotification notification = new Notification { Title = "Notification", Content = "Hello Tizen", Icon = "Icon path", Count = 3 }; Notification.LockStyle lockStyle = new Notification.LockStyle { IconPath = "Icon path", ThumbnailPath = "Thumbnail Path" }; notification.AddStyle(lockStyle); NotificationManager.Post(notification);
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
API Level: 3
Declaration
C#Copypublic void Dispose()
API Level: 3
Declaration
C#Copypublic Bundle GetExtraData(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the extra data to get. |
Returns
Type | Description |
---|---|
Bundle | Bundle Object that include extra data |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
API Level: 4
Declaration
C#Copypublic T GetStyle<T>() where T : Notification.StyleBase, new()
Returns
Type | Description |
---|---|
T | The Notification.Style object associated with the given style. |
Type Parameters
Name | Description |
---|---|
T | Type of notification style to be queried. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
API Level: 3
Declaration
C#Copypublic void RemoveExtraData(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the extra data to add. |
Remarks
The type of extra data is bundle.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
API Level: 4
Declaration
C#Copypublic void RemoveStyle<T>() where T : Notification.StyleBase, new()
Type Parameters
Name | Description |
---|---|
T | Type of notification style to be queried. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |
API Level: 3
Declaration
C#Copypublic void SetExtraData(string key, Bundle value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the extra data you want to add. |
Bundle | value | The value you want to add. |
Remarks
The type of extra data is bundle.
Examples
CopyNotification notification = new Notification { Title = "Notification", Content = "Hello Tizen", Icon = "Icon path", }; Bundle bundle = new Bundle(); bundle.AddItem("key", "value"); notification.SetExtraData("firstKey", bundle);
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when argument is invalid. |