Packagecom.distriqt.extension.notifications
Classpublic class Notification
InheritanceNotification Inheritance Object

A class containing all the information and options about a notification to be displayed



Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined By
  
Constructor
Notification
Public Constants
 ConstantDefined 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
Property Detail
alertproperty
public var alert:String

The alert text displayed in ticker locations

alertActionproperty 
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.

backgroundImageproperty 
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.

backgroundImageTextColourproperty 
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:

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.

bodyproperty 
public var body:String

The body text for the notification

categoryproperty 
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.

channelIdproperty 
public var channelId:String

Specifies the channel the notification should be delivered on

colourproperty 
public var colour:String

Colour supported formats are:

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.

countproperty 
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

delayproperty 
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.

groupIconproperty 
public var groupIcon:String

An Android resource name to use as the icon for the group

groupKeyproperty 
public var groupKey:String

Notifications with the same group key are grouped together

groupSummaryproperty 
public var groupSummary:String

Summary text for the group notification

groupTitleproperty 
public var groupTitle:String

The title for the group notification (you can use %d to insert the number of notifications)

iconproperty 
public var icon:String

An Android resource name included in a custom resources extension.

idproperty 
public var id:int = 0

An identifier for this notification unique within your application.

largeIconproperty 
public var largeIcon:String

The path to a packaged image asset or a url to a public image

lightsproperty 
public var lights:Boolean = false

If true the device lights will be shown when the notification is fired.

ongoingproperty 
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

payloadproperty 
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.

priorityproperty 
public var priority:int = 0

The priority for the notificaiton

Android only

repeatIntervalproperty 
public var repeatInterval:int = 0

The desired repeat interval for this notification.

See also

soundproperty 
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".

styleproperty 
public var style:NotificationStyle

Defines the style of the notification to use for expanded views.

titleproperty 
public var title:String

The title text for the notification

vibrateproperty 
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.

Constructor Detail
Notification()Constructor
public function Notification()

Constructor

Constant Detail
PRIORITY_MAXConstant
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_MINConstant 
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.