Ullis Roboter Seite
AI2 Notifier Extension: You should notice...
Zuletzt geändert: 2024-11-04  Drucken    English translation  English translation by microsofttranslator  English translation by google

Deutsche Version   Deutsche Version


Note: The presentation of the notification is heavily dependent on the implementation by the device manufacturer.

Reference UrsNotification

Note:
Modifying a property or calling a function that modifies a notification does not affect notifications already displayed. It only has an effect on the next create.

Functions SetProgress, SetProgressEx, RemoveProgressBar and RemoveProgressBarEx that modify the progess bar of the notification are the only exceptions.

 

Note:
The Title and Text properties and parameters accept HTML tags. This is not mentioned in the description of the individual elements. Which HTML tags can be used varies depending on the implementation of the Android system. There are hints at Mark Murphy's Technical Stuff or Daniel Lew's Coding Thoughts.

Properties

AreNotificationsEnabled
Added in API level 24.
Returns whether notifications from the calling package are not blocked. Returns true for API-Levels < 24.
⇐ back
AreNotificationsPaused
Added in API level 29.
Returns whether notifications from this package are temporarily hidden. This could be done because the package was marked as distracting to the user or because the package is suspended. Returns false for API-Levels < 29.
⇐ back
AutoCancel
Make this notification automatically dismissed when the user touches it.
⇐ back
BigPicture
Added in API level 16.
Provides the bitmap to be used as the payload for the BigPicture notification.
⇐ back
CancelOnDestroy
The notification is canceled when the App is closed.
⇐ back
Color
 Added in API level 21.
The accent color to use.
⇐ back
Colorized
Added in API level 26.
Set whether this notification should be colorized. When set, the color set with Color will be used as the background color of this notification.
This should only be used for high priority ongoing tasks like navigation, an ongoing call, or other similarly high-priority events for the user.
⇐ back
IsInsistent
The audio will be repeated until the notification is cancelled or the notification window is opened.
⇐ back
IsOngoingEvent
This notification is in reference to something that is ongoing, like a phone call. The user can't cancel the notification.
⇐ back
LargeIcon
Add a large icon to the notification content view. In the platform template, this image will be shown either on the right of the notification, with an aspect ratio of up to 16:9, or (when the notification is grouped) on the left in place of the small icon.
⇐ back
NoClear
The notification should not be canceled when the user clicks the Clear All button.
⇐ back
NumberID
The unique Id of this notification. A new notification with the same NumberID updates an existing one.
⇐ back
OnlyAlertOnce
Sound, vibrate and ticker are played if the notification is not already showing.
⇐ back
SmallIconImage
Added in API level 23.
Set the small icon, which will be used to represent the notification in the status bar and content view.
⇐ back
SmallSystemIcon
Set the small icon resource, which will be used to represent the notification in the status bar.
⇐ back
Text
Set the second line of text in the platform notification template. The text can be formatted with HTML tags. Which HTML tags can be used varies depending on the implementation of the Android system. There are hints at Mark Murphy's Technical Stuff or Daniel Lew's Coding Thoughts.
⇐ back
Title
Set the first line of text in the platform notification template. The text can be formatted with HTML tags. Which HTML tags can be used varies depending on the implementation of the Android system. There are hints at Mark Murphy's Technical Stuff or Daniel Lew's Coding Thoughts.
⇐ back
VersionSDK
The SDK version of the software currently running on this hardware device. This value never changes while a device is booted, but it may increase when the hardware manufacturer provides an OTA update.
⇐ back
UseMediaStyle
Added in API level  21.
Media are diplayed (Create a notification with media controls). Action buttons and BigPicture then no longer have any effect / function.
Added in API level  24.
Colorized and Color define the background color of the notification (DecoratedMediaCustomViewStyle).
⇐ back
When
Adds a timestamp pertaining to the notification (usually the time the event occurred).
⇐ back
WhenChronometerCountDown
Added in API level 24.
Sets the Chronometer to count down instead of counting up.
⇐ back
WhenEnabled
Added in API level 17.
Control whether the timestamp is shown in the content view.
⇐ back
WhenUsesChronometer
Added in API level 16.
Shows the Notification.when field as a stopwatch.
⇐ back

Functions

AddActionButton (Title, UrsIntentObject)
Added in API level 16.
Adds action buttons to the notification. Up to three buttons are supported. The text can be formatted with HTML tags. Which HTML tags can be used varies depending on the implementation of the Android system. There are hints at Mark Murphy's Technical Stuff or Daniel Lew's Coding Thoughts.

If the object specified in the UrsIntentObject parameter is not of the UrsIntent type, the notification is not created and Screen.ErrorOccurred is triggered with ErrorNumber 17006.

If the Title parameter is empty, the button is not added and Screen.ErrorOccurred is triggered with ErrorNumber 17010.
⇐ back
AddMediaButton (Title, Icon, ShowInCampactView, UrsIntentObject)
Ab API Level 21.
Adds media buttons to the notification. The text can be formatted with HTML tags. Which HTML tags can be used varies depending on the implementation of the Android system. There are hints at Mark Murphy's Technical Stuff or Daniel Lew's Coding Thoughts.

Icon is the name of an asset grafic file (Media section at App Inventor ). On some devices there is an additional compact representation of the notification. ShowInCampactView defines whether the button is also displayed in the compact display. .

If the object specified in the UrsIntentObject parameter is not of the UrsIntent type, the notification is not created and Screen.ErrorOccurred is triggered with ErrorNumber 17006.

If the Title parameter is empty, the button is not added and Screen.ErrorOccurred is triggered with ErrorNumber 17010.

If the Icon parameter is empty, the button is not added and Screen.ErrorOccurred is triggered with ErrorNumber 17011.
⇐ back
Cancel()
Cancels the notification.
⇐ back
Create (UrsChannelObject, UrsIntentObject)
Creates and opens a notification. Identical with UrsAI2NotificationChannel.CreateNotification.

If the object specified in the UrsChannelObject parameter is not of the UrsAI2NotificationChannel type, the notification is not created and Screen.ErrorOccurred is triggered with ErrorNumber 17001.

If the object specified in the UrsIntentObject parameter is not of the UrsIntent type, the notification is not created and Screen.ErrorOccurred is triggered with ErrorNumber 17006.
⇐ back
RemoveActionButtons ()
Removes the action buttons from the notifiaction.
⇐ back
RemoveMediaButtons ()
Removes the media buttons from the notifiaction.
⇐ back
RemoveOnDestroyAction ()
Removes the notification that is shown when the app is closed (see SetOnDestroyAction).
⇐ back
RemoveProgressBar ()
Removes a progress bar from the notification. The notification has to be created with UrsNotificationChannel.CreateProgressNotification.

If the notification has not been created yet the function has no affect and Screen.ErrorOccurred is triggered with ErrorNumber 17009.
⇐ back
RemoveProgressBarEx (Title, Text)
Removes a progress bar from the notification and updates Title and Text property. The notification has to be created with UrsNotificationChannel.CreateProgressNotification.

If the notification has not been created yet the function has no affect and Screen.ErrorOccurred is triggered with ErrorNumber 17009.
⇐ back
SetOnDestroyAction (UrsChannelObject, UrsNotificationObject, UrsIntentObject)
Defines a notification that is shown when the app is closed.

If the object specified in the UrsChannelObject parameter is not of the UrsAI2NotificationChannel type, the notification is not created and Screen.ErrorOccurred is triggered with ErrorNumber 17001.

If the object specified in the UrsNotificationObject parameter is not of the UrsNotification type, the notification is not created and Screen.ErrorOccurred is triggered with ErrorNumber 17005.

If the object specified in the UrsIntentObject parameter is not of the UrsIntent type, the notification is not created and Screen.ErrorOccurred is triggered with ErrorNumber 17006.

⇐ back
SetProgress (CurrentProgress)
Added in API level 16.
Set the progress this notification represents. The notification has to be created with UrsNotificationChannel.CreateProgressNotification.

If the notification has not been created yet the function has no affect and Screen.ErrorOccurred is triggered with ErrorNumber 17009.
⇐ back
SetProgressEx (Title, Text, CurrentProgress)
Added in API level 16.
Set the progress this notification represents and updates Title and Text property. The notification has to be created with UrsNotificationChannel.CreateProgressNotification.

If the notification has not been created yet the function has no affect and Screen.ErrorOccurred is triggered with ErrorNumber 17009.
⇐ back

Events

OnClick(IntentID)
If an UrsIntent with ActionType Event is specified for the notification's event or for an action button, this event is raised when the user tapps the notification or the button.
⇐ back
OnNewIntent(IntentID, StartValue)
The event is triggered when an already open screen is brought to the foreground by the intent (see About the BackStack (Activity Stack)). Alternatively, the Screen.Initialize event is triggered.
⇐ back
UserCanceled()
The notification was canceled by the user.
⇐ back