Actions are buttons displayed on the notification that can allow users to do something without starting the app. e.g Call back a missed call, pause a sound track, etc
The icon file should manually copied to the Objects\res\drawable\ folder and set to read-only. The file name is case sensitive and should not contain the file extension. If tag is set to "" then it will default to the passed title.
tags are named 'Notification_Action_Tag'
Use AddAction2 to pass a Service module instead of an Activity.
MAXIMUM of 3 Actions can be added to each notification.
i.e NotificationWearableExtender is used to extend the notification with functions only available to Wearable devices.
Gets the Notification Object. Useful for things like Foreground Services
GroupAsString [write only]
Set this notification to be part of a group of notifications sharing the same key. Grouped notifications may display in a cluster or stack on devices which support such rendering.
To make this notification the summary for its group, also call nb.GroupSummary = True A sort order can be specified by using nb.SortKey(Key)
GroupSummaryAsBoolean [write only]
Set this notification to be the group summary for a group of notifications. Grouped notifications may display in a cluster or stack on devices which support such rendering.
The GroupSummary notification will not show on the notification stack on Wearables, but will show as the only notification on handheld devices. See URL Click
Requires a group key also be set using nb.Group(GroupKey)
LargeIconAsandroid.graphics.Bitmap [write only]
Add a large icon to the notification (and the ticker on some devices). In the platform template, this image will be shown on the left of the notification view in place of the small icon (which will move to the right side).
LocalOnlyAsBoolean [write only]
Sets whether or not this notification is only relevant to the current device. Some notifications can be bridged to other devices for remote display. I.E Wear Devices
Displays the notification. id - The notification id. This id can be used later to update the notification (by calling Notify again with the same id), or to cancel the notification
Gets or Sets the number to be shown on the notification. This is useful to represent multiple events in a single notification.
OnGoingEventAsBoolean [write only]
Sets whether the notification is an 'ongoing event'. The notification will be shown in the ongoing section and will not be cleared.
OnlyAlertOnceAsBoolean [write only]
Sets whether the notification will only play sound / vibrate /show light if the notification is not already showing.
PriorityAsInt [write only]
Experimental - Googles' notes:- 'Set the relative priority for this notification. Priority is an indication of how much of the user's valuable attention should be consumed by this notification. Low-priority notifications may be hidden from the user in certain situations, while the user might be interrupted for a higher-priority notification. The system sets a notification's priority based on various factors including the setPriority value. The effect may differ slightly on different platforms.'
Sets the activity that will be launched when the Notification is tapped.
Use nb.Intent to use your own calling intent
setCustomLight (argbAsInt, onMsAsInt, offMsAsInt)
Sets a custom argb value for the notification light, also sets the rates at which it flashes. argb - The color that the devices led will flash. onMs - The time in milliseconds that the led will stay on each blink. offMs - The time in millliseconds that the led will be off after each blink.
NOTE: Not all devices will honour these settings, it is dependent on hardware abilities.
Experimental - Setting a DeleteActivity will (should) show the activity when the user clears the notification manually.
Experimental - Setting a DeleteService will (should) show the service when the user clears the notification manually.
Sets the Intent that will be called when the Notification is tapped.
Use nb.Activity to call an activity in your project.
Sets a Parent Activity to add to the 'Back Stack'. If this method is used then once you have entered an Activity from your notification, pressing back will return to the Parent Activity, rather than exiting the App.
Must be passed a style object:- NotificationInboxStyle NotificationBigTextStyle NotificationBigPictureStyle
ShowTimeAsBoolean [write only]
Sets whether the time stamp is shown on the notification. Default is 'true'
SmallIconAsString [write only]
Sets the Small Icon to be displayed. The image file should manually copied to the Objects\res\drawable\ folder and set to read-only. The file name is case sensitive and should not contain the file extension. You can use "icon" to use the applications icon.
SortKeyAsString [write only]
Set a sort key that orders this notification among other notifications from the same package. This can be useful if an external sort was already applied and an app would like to preserve this. Notifications will be sorted lexicographically using this value.
This sort key can also be used to order members of a notification group.
SubTextAsString [write only]
Set the third line of text in the platform notification template. Don't use if you're also using setProgress(); they occupy the same location in the standard template. If the platform does not provide large-format notifications, this method has no effect. The third line of text only appears in expanded view.
TagAsString [write only]
The Tag is a string that can be extracted later on Activity_Resume. This can be used to determine which notification has been clicked by the user when multiple notifications exist.
Example of extracting the Tag: SubActivity_Resume DiminasIntent DimintentExtraasString
in = Activity.GetStartingIntent Ifin.HasExtra("Notification_Tag") Then intentExtra = in.GetExtra("Notification_Tag")
TickerAsString [write only]
Sets the Ticker Text which shows along side the status bar icon of new Notifications.
UsesChronoAsBoolean [write only]
If set the timestamp place on the notification will be used as a stopwatch. It will automatically update the minutes and seconds since .When()
WhenAsLong [write only]
Sets the time stamp that shows on the notification. This should indicate the time the event occurred. Default is the current time. Setting to 0 will reset to current time.
Enables the Click action for a view in a custom layout.
View - The name of the view as defined in the xml layout Activity - The activity that will be launched when the view is clicked (Maybe service will work too) Tag - The tag that will be returned as an extra in the starting intent
Sets the parameters for a progress bar used in a notification
ProgressBar - The name of the progress bar as defined in the xml layout MaxProgress - the upper limit of the progress bar. A good value is 100 Progress - the current level of progress to be shown. Must be <= maxProgress. Indeterminate - set the progress bar as indeterminate
SetTextColor (TextFieldAsString, ColorAsInt)
Sets the color of the text in a text field in a custom layout
TextField - The name of the text element as defined in the xml layout Color - The color that will be assigned to the text element
SetTextField (TextFieldAsString, TextAsString)
Sets the text field in a custom layout
TextField - The name of the text element as defined in the xml layout Text - The string that will be assigned to the text element
Extracts a RemoteInput (voice) string from starting intent
Use this in the Activity_Resume of the Activity called by the Action. Example:
DimInasintent In = Activity.GetStartingIntent IfIn.HasExtra("Notification_Wear_Action_Tag") Then IfIn.GetExtra("Notification_Wear_Action_Tag") = TagThen'Tag set when adding Action to Notification DimRemasNotificationRemoteInput
ToastMessageShow(Rem.GetRemoteInput(In, Label), false) 'Label set on Initialize EndIf EndIf
Initializes the object.
Label - Used to retrieve the reply later.
See GetRemoteInput for details on how to get the input.
NOTE: you do not need to call Initialize in order to use GetRemoteInput.
LabelAsString [write only]
Sets the label to show when requesting for voice input
Adds an additional page to notifications shown on Wear Device
Page - A new notification.
DimNotification1, Notification2asNotificationBuilder 'code to build notifications ...
Set or Get the background of the Wear Notification (no matter what the Style)
Clears any previously added Actions.
Clears any previously added Pages.
ContentActionAsInt [write only]
Sets the action to be clickable with the content of this notification. i.e. When you click the main notification, it will trigger the Action.
This action will no longer display separately from this notification's content. For notifications with multiple pages, child pages can also have content actions set, although the list of available actions comes from the main notification and not from the child page's notification.
ActionIndex is the ID of the Action to use. ID's start at 0
ContentIconAsString [write only]
Sets the Icon that goes with the content of this notification
The image file should manually copied to the Objects\res\drawable\ folder and set to read-only. The file name is case sensitive and should not contain the file extension. You can use "icon" to use the applications icon.
ContentIconGravityAsInt [write only]
Sets the gravity for the ContentIcon. Supported values START, END Use the built in constants. e.g WearExtender.START
Sets whether the content intent is available when the wearable device is not connected to a companion device.
Sets or Gets the custom height for the display of this notifications content.
NOTE: This option is only available for custom display notifications created using DisplayIntent
Sets or Gets the custom size preset for the display of this notification out of the available presents. Use the built in constants. e.g. WearExtender1.SIZE_LARGE Possible values - SIZE_DEFAULT, SIZE_FULL_SCREEN, SIZE_LARGE, SIZE_MEDIUM, SIZE_SMALL, SIZE_XSMALL
GravityAsInt [write only]
Sets the gravity of the Notification on the device. Supported values BOTTOM, CENTER_VERTICALLY, TOP Use the built in constants. e.g WearExtender.TOP
HideIconAsBoolean [write only]
Hides the Icon if set to true.
Initializes the object
Googles Docs ------------ Set an activity to be displayed while viewing the notification.
My Version after doing a little research ---------------------------------------- When creating a notification directly from an App on the Wear device, you can use custom layouts. This is done by creating the layout in an activity in the App. Then call this method, passing the layout activity as the Parameter.
The activity to launch needs to allow embedding, must be exported and should have an empty task affinity. It is also recommended to use the device default light theme. This is achieved by adding the following to the Manifest Editor
Only the background image of this notification should be displayed, and other semantic content should be hidden. This method only applies to sub Pages.
StartScrollBottomAsBoolean [write only]
Sets whether the scrolling position for the contents of this notification should start at the bottom of the contents instead of the top when the contents are too long to display within the screen. Default is false (start scroll at the top)