ShowNotification(title$, msg$[, table])
msg$
to the user. The notification box will use the title specified in title$
. If you pass an
empty string ("") in the title$
parameter, the notification will use the title specified
in the @APPTITLE preprocessor command.
The optional table argument can be used to configure further parameters for the system
notification. The following tags are currently recognized by the table
argument:
Icon:
#REQICON_NONE:
#REQICON_INFORMATION:
#REQICON_ERROR:
#REQICON_WARNING:
#REQICON_QUESTION:
Note that not all platforms support this tag.
Timeout:
#DURATION_SHORT:
#DURATION_LONG:
Note that on Android, you must pass one of the special constants listed above. Passing
a millisecond value directly isn't supported on Android. Also note that not all platforms
support the Timeout
tag.
X:
#CENTER
. This tag is only supported on Android and
iOS.
Y:
#CENTER
. This tag is only supported on Android and
iOS.
NoSound:
True
if you don't want any sound to accompany the notification. This tag
is currently only supported on macOS.
Note that on Windows notifications can only be shown if your application has a tray icon.
Thus, ShowNotification()
will automatically add a tray icon for your application if there
is none yet. If you would like to manually install a tray icon for your application on
Windows, call SetTrayIcon() before calling ShowNotification()
.
See SetTrayIcon for details.
Also note that on AmigaOS 4 ShowNotification()
is implemented through application.library's
Ringhio system and thus can only be used if your script has registered itself as an AmigaOS 4
application using the RegisterApplication
tag in @OPTIONS. If you need
fine-tuned control over Ringhio messages and you don't need to be portable, you can also
use the ShowRinghioMessage() function on AmigaOS 4 instead
because this offers even more configuration options. See ShowRinghioMessage for details.
On MorphOS ShowNotification()
uses MagicBeacon's notification system. On AmigaOS 3 Ranchero
is used for showing notifications. Note that since apps need to register before they can show
notifications with Ranchero it's recommended that if you intend to use ShowNotification()
on
AmigaOS 3 with Ranchero you should also use @APPIDENTIFIER to specify a
unique ID for your app. Otherwise the generic app name "Hollywood" will be used.