A message displayed to the user that does not usually require user interaction to be dismissed
The toast will be dismissed after a predefined timeout period lapses (around 3 seconds). If the toast includes a button, then the timeout period is activated with the first user interaction, for example, user touching the screen. During this time, if a button is displayed, the user can select it.
buttonTitle
- String- String representing the title of the button
- No button will show if left empty
icon
- String- String with the path of the icon for the toast.
- No icon will show if left empty
message
- String- Toast message body of the notification
position
- Constant Number- Vertical position of the toast.
- Use any of the following:
Ti.BlackBerry.POSITION_TYPE_MIDDLE_CENTER
Ti.BlackBerry.POSITION_TYPE_TOP_CENTER
Ti.BlackBerry.POSITION_TYPE_BOTTOM_CENTER
- Defaults to
Ti.BlackBerry.POSITION_TYPE_MIDDLE_CENTER
if not specified
modality
- Constant Number- Sets the modality for the toast.
- Use any of the following (Elevated permissions are required to use global modality)
Ti.BlackBerry.MODALITY_APPLICATION
Ti.BlackBerry.MODALITY_GLOBAL
- Defaults to
Ti.BlackBerry.MODALITY_APPLICATION
if not specified
show()
- Display's the toast on the screen
cancel()
- Dismisses the toast when called.
finish
- Fires when the toast dismisses.
- Event properties:
result
description of how the toast was dismissedtype
event name: finishsource
the proxy
var toast = Ti.BlackBerry.createToast({
buttonTitle: 'Ok',
message: 'This is a cool toast!',
position: Ti.BlackBerry.POSITION_TYPE_TOP_CENTER,
});
toast.show();
toast.addEventListener('finish', function(e) {
Ti.API.info(JSON.stringify(e));
});