Package | com.distriqt.extension.notifications |
Class | public class Notification |
Inheritance | Notification ![]() |
Property | Defined By | ||
---|---|---|---|
alert : String
The alert text displayed in ticker locations
| Notification | ||
alertAction : String
Supported: iOS
The title of the action button or slider.
Assign a string as the value. | Notification | ||
backgroundImage : String
Specify the image to use for the background of the image. | Notification | ||
backgroundImageTextColour : String
If you have specified a background image to use for the content of the notification
this colour is used for the text. | Notification | ||
body : String
The body text for the notification
| Notification | ||
category : String
The action category, indicates the actions to display along with this notification
This should match a category that you added to the Service in the setup call. | Notification | ||
channelId : String
Specifies the channel the notification should be delivered on
| Notification | ||
colour : String
Colour supported formats are:
#RRGGBB
#AARRGGBB
The following names are also accepted: red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, olive, purple, silver, and teal. | Notification | ||
count : int = 0
On iOS this is the number to display as the application’s icon badge. | Notification | ||
delay : int = 0
The number of seconds delay from now to fire this notification. | Notification | ||
groupIcon : String
An Android resource name to use as the icon for the group
| Notification | ||
groupKey : String
Notifications with the same group key are grouped together
| Notification | ||
groupSummary : String
Summary text for the group notification
| Notification | ||
groupTitle : String
The title for the group notification (you can use %d to insert the number of notifications)
| Notification | ||
icon : String
An Android resource name included in a custom resources extension. | Notification | ||
id : int = 0
An identifier for this notification unique within your application. | Notification | ||
largeIcon : String
The path to a packaged image asset or a url to a public image
| Notification | ||
lights : Boolean = false
If true the device lights will be shown when the notification is fired. | Notification | ||
ongoing : Boolean = false
Sets whether the notification is an ongoing notification. | Notification | ||
payload : String
Custom data payload string to attach to this notification. | Notification | ||
priority : int = 0
The priority for the notificaiton
Android only
| Notification | ||
repeatInterval : int = 0
The desired repeat interval for this notification. | Notification | ||
sound : String = default
The file name of the sound file to play when the notification is
fired. | Notification | ||
style : NotificationStyle
Defines the style of the notification to use for expanded views. | Notification | ||
title : String
The title text for the notification
| Notification | ||
vibrate : Boolean = false
Use the default notification vibrate.
Setting this to true requires that you request the vibrate permission for the application
If true the notification will cause the phone to vibrate
Note: On iOS the vibration will only occur if the
application is in the foreground when the notification is received and if
the user has enabled vibration (see the notes in playSound). | Notification |
Method | Defined By | ||
---|---|---|---|
Constructor
| Notification |
Constant | Defined By | ||
---|---|---|---|
PRIORITY_MAX : int = 2 [static]
Highest notification priority for setPriority(int), for your application's most important items that require the user's prompt attention or input. | Notification | ||
PRIORITY_MIN : int = -2 [static]
Lowest notification priority for setPriority(int); these items might not be shown to the user except under special circumstances, such as detailed notification logs. | Notification |
alert | property |
public var alert:String
The alert text displayed in ticker locations
alertAction | property |
public var alertAction:String
Supported: iOS
The title of the action button or slider.
Assign a string as the value. The alert action is the title of the right button of the alert or the value of the unlock slider, where the value replaces "unlock" in "slide to unlock".
If you specify nil, and body
is not empty, "View" (localized to the preferred language) is used as the default value.
backgroundImage | property |
public var backgroundImage:String
Specify the image to use for the background of the image. This should be a path to the packaged image asset or a URL to a public image. URL's are discouraged due to the network access and download required.
backgroundImageTextColour | property |
public var backgroundImageTextColour:String
If you have specified a background image to use for the content of the notification this colour is used for the text. This allows you to match the text to your images.
Uses the system notification default colours if not specified.
Colour supported formats are:
body | property |
public var body:String
The body text for the notification
category | property |
public var category:String
The action category, indicates the actions to display along with this notification
This should match a category that you added to the Service in the setup
call.
channelId | property |
public var channelId:String
Specifies the channel the notification should be delivered on
colour | property |
public var colour:String
Colour supported formats are:
count | property |
public var count:int = 0
On iOS this is the number to display as the application’s icon badge.
Setting this to less than zero will clear the count icon
The current notification count associated with this notification
delay | property |
public var delay:int = 0
The number of seconds delay from now to fire this notification.
This is supported on iOS and now on Android with version > 1.1.
Android Note: Beginning in API 19, the trigger time passed to this method is treated as inexact: the alarm will not be delivered before this time, but may be deferred and delivered some time later. The OS will use this policy in order to "batch" alarms together across the entire system, minimizing the number of times the device needs to "wake up" and minimizing battery use. In general, alarms scheduled in the near future will not be deferred as long as alarms scheduled far in the future.
With the new batching policy, delivery ordering guarantees are not as strong as they were previously. If the application sets multiple alarms, it is possible that these alarms' actual delivery ordering may not match the order of their requested delivery times.
groupIcon | property |
public var groupIcon:String
An Android resource name to use as the icon for the group
groupKey | property |
public var groupKey:String
Notifications with the same group key are grouped together
groupSummary | property |
public var groupSummary:String
Summary text for the group notification
groupTitle | property |
public var groupTitle:String
The title for the group notification (you can use %d to insert the number of notifications)
icon | property |
public var icon:String
An Android resource name included in a custom resources extension.
id | property |
public var id:int = 0
An identifier for this notification unique within your application.
largeIcon | property |
public var largeIcon:String
The path to a packaged image asset or a url to a public image
lights | property |
public var lights:Boolean = false
If true the device lights will be shown when the notification is fired.
ongoing | property |
public var ongoing:Boolean = false
Sets whether the notification is an ongoing notification.
Ongoing notifications differ from regular notifications in the following ways:
Android only
payload | property |
public var payload:String
Custom data payload string to attach to this notification.
This will be returned to in the notification events so you should include something here to identify the notification and required action.
priority | property |
public var priority:int = 0
The priority for the notificaiton
Android only
repeatInterval | property |
public var repeatInterval:int = 0
The desired repeat interval for this notification.
See also
sound | property |
public var sound:String = default
The file name of the sound file to play when the notification is fired. On iOS this should be a caf file and on Android an mp3 file.
This name does not require the extension to allow for cross platform,
in this way if you have two sounds eg notification.mp3
and notification.caf
the correct file extension will be appended on the respective platform (mp3 on Android and caf on iOS), eg:
notification.sound = "notification";
The sound must be packaged as part of your application and reference the path relative to the main application file.
Flash builder normally will do this automatically when you add a sound, however you should double check under: Actionscript Build Packaging / [Platform] / Package contents
iOS: Sounds that last longer than 30 seconds are not supported. If you specify a file with a sound that plays over 30 seconds, the default sound is played instead.
Note: Under iOS this has some restrictions. The user can select the notification setting in their system settings so setting this to true will either:
To disable sound set this to an empty string
The default value is default notification sound: "default"
.
style | property |
title | property |
public var title:String
The title text for the notification
vibrate | property |
public var vibrate:Boolean = false
Use the default notification vibrate.
Setting this to true requires that you request the vibrate permission for the application
If true the notification will cause the phone to vibrate
Note: On iOS the vibration will only occur if the application is in the foreground when the notification is received and if the user has enabled vibration (see the notes in playSound).
Supported: Android, partial iOS
The default value is false
.
Notification | () | Constructor |
public function Notification()
Constructor
PRIORITY_MAX | Constant |
public static const PRIORITY_MAX:int = 2
Highest notification priority for setPriority(int), for your application's most important items that require the user's prompt attention or input.
PRIORITY_MIN | Constant |
public static const PRIORITY_MIN:int = -2
Lowest notification priority for setPriority(int); these items might not be shown to the user except under special circumstances, such as detailed notification logs.