The Notification object can be used to put messages in the notification drawer.
ntf = app.CreateNotification(
→ app object:
The “AutoCancel” option will automatically dismiss the notificatin if the user touches it. “FullScreen” tries to create a larger notification on the screen. And “OnGoing” makes the Notification closeable by your app only.
Use the SetMessage method to tell the object what to display
notify.SetMessage( ticker, title, text );
The Notify method tells it to send the notification:
notify.Notify( id );
When the user touches your notification, your app will come to the front, even if it was not running.
If you use more than one notification, app.GetNotifyId can be used to check which notification was pressed by the user.
Example - Notification
app.ShowPopup( "Sending notification" );
notify = app.CreateNotification();
notify.SetMessage( "Ticker", "Title", "Text" );
notify.Notify( "testID" );
setTimeout( cancel, 5000 );
notify.Cancel( "testID" );
app.ShowPopup( "Notification cancelled" );
The following methods are available on the Notification object:
hexadecimal: “#rrggbb”, “#aarrggbb”
colourName: “red”, “green”, ...
string: path to file or folder ( “/absolute/...” or “relative/...” )
string: comma “,” separated: “Ongoing”, “AutoCancel”, “FullScreen”
Cancel a notification with a specific id.
Returns the control class name.
Send the notification to the user.
Set an image which will be displayed bigger than usual.
Activate the device notification LEDs.
Set notification texts.
Set a small image in your notification.