Titanium.Android.Notification

Object of Titanium.Android.
Platform Since
Android 1.5

Summary

The Titanium binding of an Android Notification.

Description

If you pass contentTitle and/or contentText into Titanium.Android.createNotification, then setLatestEventInfo will automatically be called with those properties (there's no need to call it separately unless you want to). You can also use a custom layout.xml wrapped in a Titanium.Android.RemoteViews object in the contentView property, which gives more fine grained control and customization to how the notification actually behaves.

Also see Android's developer guide for Notifications

Methods

Name Summary
addEventListener

Adds the specified callback as an event listener for the named event.

fireEvent

Fires a synthesized event to any registered listeners.

getAudioStreamType

Gets the value of the audioStreamType property.

getContentIntent

Gets the value of the contentIntent property.

getContentText

Gets the value of the contentText property.

getContentTitle

Gets the value of the contentTitle property.

getDefaults

Gets the value of the defaults property.

getDeleteIntent

Gets the value of the deleteIntent property.

getFlags

Gets the value of the flags property.

getIcon

Gets the value of the icon property.

getLedARGB

Gets the value of the ledARGB property.

getLedOffMS

Gets the value of the ledOffMS property.

getLedOnMS

Gets the value of the ledOnMS property.

getNumber

Gets the value of the number property.

getSound

Gets the value of the sound property.

getTickerText

Gets the value of the tickerText property.

getWhen

Gets the value of the when property.

removeEventListener

Removes the specified callback as an event listener for the named event.

setAudioStreamType

Sets the value of the audioStreamType property.

setContentIntent

Sets the value of the contentIntent property.

setContentText

Sets the value of the contentText property.

setContentTitle

Sets the value of the contentTitle property.

setDefaults

Sets the value of the defaults property.

setDeleteIntent

Sets the value of the deleteIntent property.

setFlags

Sets the value of the flags property.

setIcon

Sets the value of the icon property.

setLatestEventInfo

Sets the latest event info using the builtin Notification View for this notification. See Android's documentation for setLatestEventInfo

setLedARGB

Sets the value of the ledARGB property.

setLedOffMS

Sets the value of the ledOffMS property.

setLedOnMS

Sets the value of the ledOnMS property.

setNumber

Sets the value of the number property.

setSound

Sets the value of the sound property.

setTickerText

Sets the value of the tickerText property.

setWhen

Sets the value of the when property.

Properties

Name Type Summary
audioStreamType Number

The audio stream type to use when playing the sound.

contentIntent Object

The Titanium.Android.PendingIntent to execute when the expanded status entry is clicked.

contentText String

Description text of the notification.

contentTitle String

Title of the notification.

defaults Number

Specifies which values should be taken from the defaults.

deleteIntent Object

The Titanium.Android.PendingIntent to execute when the status entry is deleted by the user with the "Clear All Notifications" button.

flags Number

Set of flags for the notification, defaults to Titanium.Android.FLAG_AUTO_CANCEL. Possible values: Titanium.Android.FLAG_AUTO_CANCEL, Titanium.Android.FLAG_INSISTENT, Titanium.Android.FLAG_NO_CLEAR, Titanium.Android.FLAG_ONGOING_EVENT, Titanium.Android.FLAG_ONLY_ALERT_ONCE, Titanium.Android.FLAG_SHOW_LIGHTS

icon Number or String

A resource id or URL to an icon (the URL must be an image located in Resources/android/images/ or an Android content URI)

ledARGB Number

The color for the LED to blink

ledOffMS Number

The number of milliseconds for the LED to be off while it's flashing.

ledOnMS Number

The number of milliseconds for the LED to be on while it's flashing.

number Number

The number of events that this notification represents.

sound String

A URL to the sound to play (supports Android + Titanium URLs)

tickerText String

Text to scroll across the screen when this item is added to the status bar.

when Date or Number

The timestamp for the notification (defaults to the current time)

Events

This type has no events.