Note
This API has been available since API level 11.
This API has been available since API level 11.
Manages the system notifications.
Enables apps or services to manage system notifications. The main types of notifications supported are:
API level 11
Closes the currently displayed alert notification.
Name | Required | Type | Description |
---|---|---|---|
alertId | Required | String | The ID of the alert notification to close. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
None | Message is not parsed | This message implies that a JSON message parsing error occured. One of the following situations can cause the parsing error:
|
None | Alert ID can't be empty | This message implies that the alertId field in the message is empty or missing. |
None | Alert ID parse error | This message implies that the alertId is not formatted properly. |
Example code
# luna-send -n 1 -f -a com.webos.surfacemanager luna://com.webos.notification/closeAlert '{"alertId":"com.webos.surfacemanager-1582876366095"}'
Response:
{
"returnValue": true
}
API level 12
Closes all the open alerts.
Note: This method is for internal use. It must only be used by com.webos.service.battest during BAT test. If the caller is not com.webos.service.battest, the method will fail.
None
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
None | Unknown Source | This message implies that the system was unable to retrieve the app source ID from the system bus message. |
None | Message is not parsed | This message implies that a JSON message parsing error occured. One of the following situations can cause the parsing error:
|
None | Invalid source ID specified | If call is not from com.webos.service.battest, notification refuses API request with this error. |
Example code
Example for a successful call:
# luna-send -n 1 -f -a com.webos.service.battest luna://com.webos.notification/closeAllAlerts '{}'
Response:
{
"returnValue":true
}
Example for a failed call:
# luna-send -n 1 -f luna://com.webos.notification/closeAllAlerts '{}'
Response:
{
"returnValue":false,
"errorText":"Unknown Source"
}
API level 11
Removes a toast notification from the database.
Name | Required | Type | Description |
---|---|---|---|
toastId | Optional | String | ID of the toast notification to remove from the database. Note: Either toastId or sourceId is required. |
sourceId | Optional | String | ID of the app/service to remove from the database. Note: Either toastId or sourceId is required. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
None | Toast ID parse error | Indicates that the toastId is not formatted properly. |
None | Both Toast ID and Source ID can't be empty | Indicates that neither toastId or sourceId field in the message is empty or missing. |
None | Message is not parsed | Indicates that a JSON message parsing error occured. Possible situations that can cause the parsing error:
|
Example : With toast ID
# luna-send -n 1 -f -a com.webos.app.test luna://com.webos.notification/closeToast '{
"toastId":"com.webos.app.test-1433221930402"
}'
Response:
{
"returnValue":true
}
Example : With source ID
# luna-send -n 1 -f -a com.webos.app.test luna://com.webos.notification/closeToast '{
"sourceId":"com.webos.app.test"
}'
Response:
{
"returnValue":true
}
API level 11
Creates a system alert notification.
Name | Required | Type | Description |
---|---|---|---|
iconUrl | Optional | String | The file path of the alert icon. The file path must be local to the device. |
title | Optional | String | A brief title for the alert notification. |
message | Required | String | A detailed message for the alert notification. |
modal | Optional | Boolean | Indicates whether to display a modal or non-modal alert notification. Possible values are:
Note: The default value is false. |
buttons | Required | Object array: button | Defines the button label, and onclick action. Button specification is given in an array. An example is: "buttons":[ |
onclose | Optional | Object: onclose | Defines the close action to be performed when an alert is closed. |
type | Optional | String | Defines the button type in the alert. Possible values are:
|
isSysReq | Optional | Boolean | Indicates whether the notification has come from an app or system
|
onfail | Optional | Object: onfail | Action to be performed on failure to create an alert. |
Name | Required | Type | Description |
---|---|---|---|
alertId | Optional | String | The ID of the created alert notification. This would be sourceId + "-" + Timestamp. |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
100, 103, 104, 105, 106 | Depends on error code | See the 'API Error Codes Reference' table for detailed information on relevant error code. |
Example scenario
# luna-send -n 1 -f -a com.webos.surfacemanager luna://com.webos.notification/createAlert '{
"message":"hello world",
"buttons":[
{
"label":"launch",
"params":{
"id":"youtube.leanback.v4"
}
}
]
}'
Response:
{
"alertId":"com.webos.surfacemanager-1582247038454",
"returnValue":true
}
API level 11
Creates a toast notification.
Name | Required | Type | Description |
---|---|---|---|
sourceId | Optional | String | The ID of the application or service that creates the toast notification. |
iconUrl | Optional | String | The file path of the alert icon. The file path must be local to the device. NOTE: The icon must be 80 x 80 and in PNG format. |
message | Required | String | The detailed message to be displayed as part of the toast notification. The message can be up to 60 characters long. |
onclick | Optional | Object: onclick | Defines the toast action. An example is: {"appId":"com.webos.app.test"} |
noaction | Optional | Boolean | Indicates no action is required. Possible values are:
Note: The default value is false. |
stale | Optional | Boolean | Possible values are:
Note: The default value is false. |
persistent | Optional | Boolean | Indicates whether the toast message should be saved in the database. If persistent is set to true, the toast message will be saved in the database. |
isSysReq | Optional | Boolean | Defines notification comes from app or system
|
schedule | Optional | Object: schedule | Creates a toast notification as a persistent message and defines its schedule. |
type | Optional | String | Defines the toast type. Possible values are:
|
extra | Optional | Object array: image | Defines extra toast resource. |
onlyToast | Optional | Boolean | Indicates if notification to be created is just a simple toast. Possible values are:
Default: true |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
toastId | Optional | String | The id of the created toast notification. This would be sourceId + "-" + Timestamp. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
100 | Message is not parsed | Indicates that the JSON message parsing error occured. Possible situations that can cause the parsing error:
|
103 | Unknown Source | Indicates that the system was unable to retrieve the app source id from the System Bus message. |
105 | Message can't be empty | Indicates that the message field in the requested message is empty. |
111 | Invalid source id specified | Indicates that the app Id given in the requested message does not match with the system bus caller Id. |
Example code
# luna-send -n 1 -f -a com.webos.app.test luna://com.webos.notification/createToast '{
"sourceId":"com.webos.app.test",
"onclick": {"appId":"com.webos.app.test"},
"message":"hello world",
"noaction": false,
"persistent":true
}'
Response:
{
"toastId": "com.webos.app.test-1435192659892",
"returnValue": true
}
API level 21
Disables all notification features (Toast, Alert, Input Alert, Pin Prompt).
Note: Only a privileged application or service can call this method.
None
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
None | Unknown Source | Indicates that the system was unable to retrieve the app/service's source id from the system bus message. |
None | Permission Denied | Indicates that the app/service does not have permission to enable notifications. |
Example code
# luna-send -n 1 -f -a com.webos.app.test luna://com.webos.notification/disable '{}'
Response:
{
"returnValue": true
}
API level 21
Enables all notification features (Toast, Alert, Input Alert, Pin Prompt).
Note: Only a privileged app/service can call this method.
None
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
None | Unknown Source | Indicates that the system was unable to retrieve the app/service's source id from the system bus message. |
None | Permission Denied | Indicates that the app/service does not have permission to enable notifications. |
Example code
# luna-send -n 1 -f -a com.webos.app.test luna://com.webos.notification/enable '{}'
Response:
{
"returnValue": true
}
API level 12
Subscribe to create alert notifications.
Note: This method should only be used by the Surface Manager.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
Note: This method always returns returnValue as true. |
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: No explicit error message will be sent out when the subscription fails because this method is intended for one specific client that is the Surface Manager. |
Name | Required | Type | Description |
---|---|---|---|
alertInfo | Required | Object: alertInfo | Contains alert info. |
timestamp | Optional | String | Indicates the timestamp string. Note: It indicates epoch time as milliseconds. |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
Note: This method always returns returnValue as true. |
alertAction | Required | String | Indicates the action that the subscriber should take. Possible alert types are:
|
onFailAction | Optional | Object: onFailAction | This parameter is retired. Indicates the action to be performed on failure to create an alert. |
Example code
# luna-send -i -f -a com.webos.surfacemanager luna://com.webos.notification/getAlertNotification '{"subscribe":true}'
Response:
{
"subscribed": true,
"returnValue": true
}
Subscription Response:
{
"returnValue":true,
"alertAction":"open",
"alertInfo":{
"iconPath":"/usr/share/asm/130x130 usb-port2.png",
"sourceId":"com.webos.surfacemanager",
"displayId":0,
"buttons":[
{
"action":{
"launchParams":{
"id":"youtube.leanback.v4"
},
"serviceURI":"luna://com.webos.service.applicationmanager/",
"serviceMethod":"launch"
},
"focus":false,
"label":"launch"
}
],
"message":"hello world",
"isNotiSave":false,
"iconUrl":" [file:///usr/share/asm/130x130] usb-port2.png",
"modal":false,
"onCloseAction":{
},
"progress":0,
"alertId":"com.webos.surfacemanager-1690213268617",
"type":"progress",
"title":"this is to get alertInfo",
"isSysReq":false,
"onFailAction":{
}
},
"timestamp":"1690213268617"
}
API level 12
Queries the toast notification details of the stored messages and provides the read/unread count of the toast notifications.
Note: Only "com.webos.surfacemanager" and "com.webos.app.notification" have permission to monitor the notification status change.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
displayId | Optional | Number | Identifier of the display where the notification is to be displayed. Possible values are 0 and 1. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
readCount | Required | Number | Indicates the count of toast notifications read by a specific user. |
unreadCount | Required | Number | Indicates the count of toast notifications unread by the user. |
totalCount | Required | Number | Indicates the total count of toast notifications respective to a user. |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
Example: Get toast count form a specific displayId
# luna-send -i -f -a com.webos.app.notification luna://com.webos.notification/getToastCount '{
"subscribe":true,
"displayId": 0
}'
Response:
{
"returnValue" : true,
"subscribed" : true
}
Subscription response:
{
"unreadCount": 2,
"totalCount": 3,
"readCount": 1,
"returnValue": true
}
API level 12
Lists the toasts created for the app/client based on the user logged into the particular session.
Name | Required | Type | Description |
---|---|---|---|
displayId | Optional | Number | Identifier of the display where the notification is to be displayed. Possible values are 0 and 1. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
toastInfo | Required | Object array: toastInfo | Contains information of the stored toasts. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
None | Unknown Source | Indicates that the system was unable to retrieve the app/service's source id from the system bus message. |
None | Permission Denied | Indicates that the app/service does not have permission to query toast list. |
None | Message is not parsed | Indicates that the required parameters were not passed to API. |
None | Can't get the notification info from db | Failed to fetch the toast list from the database. |
Example
# luna-send -n 1 -f -a com.webos.app.notification luna://com.webos.notification/getToastList '{"displayId": 0}'
Response:
{
"returnValue": true
"toastInfo" : [
{
"sourceId" : "com.webos.app.notification",
"toastId" : "com.webos.app.notification-1584349101435",
"timestamp" : "1584349101435",
"iconUrl" : "file:///usr/palm/notificationmgr/images/toast-notification-icon.png",
"iconPath" : "/usr/palm/notificationmgr/images/toast-notification-icon.png",
"title" : "",
"message" : "hello world",
"isSysReq" : false,
"user" : "guest",
"schedule" : {
"expire": 1590207128
},
"type" : "standard",
"action" : {
"launchParams": {
"id": "com.webos.app.notification"
},
"serviceMethod": "launch",
"serviceURI": "luna://com.webos.service.applicationmanager/"
}
"readStatus" : false
},
],
"displayId": 0
}
API level 12
Subscribe to created toast notification.
Note: This method should only be used by Surface Manager only.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: No explicit error message will be sent out when subscription fails because this method is intended for one speicific client that is the Surface Manager. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: This method always returns returnValue as true. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: This method always returns returnValue as true. |
message | Required | String | Contains the message to be displayed. |
type | Optional | String | Indicates the type of the toast message. Note: This is optional parameter and currently not used. This is reserved for future purpose. |
title | Optional | String | Contains the title information to be displayed for the toast. |
isCradleReq | Optional | Boolean | Indicates if this is a Cradle Request or not. Cradle Request is used for Battery Notifications only. So, it will be set to false for all other cases. Note:
|
sourceId | Required | String | Contains the source Id of the requester. |
timestamp | Required | String | Indicates the time stamp string. It indicates epoch time as milliseconds. |
isSysReq | Required | Boolean | Indicates if the notification comes from an app or system. Possible values are:
|
iconUrl | Required | String | Contains the file path to icon to be displayed. |
action | Optional | Object: action | Contains the action parameter. |
schedule | Optional | Object: schedule | Describes the toast schedule. |
iconPath | Required | String | Specifies the path of the icon. It should be absolute local file system path. |
user | Optional | String | Indicates the names of the user logged in to the corresponding session. If the user is logged in as guest user, the value will be "guest". |
_kind | Optional | String | Displays the db kind in which the toast is stored. Note: It is an internal parameter. |
onlyToast | Required | Boolean | Indicates if notification is created as a simple toast. Note: It is set when creating the toast. |
readStatus | Required | Boolean | Indicates the status of a toast to be set by the user. Possible values are:
|
timesource | Optional | String | Denotes the time source. Example: system, manual, ntp, sdp. |
displayId | Optional | Number | ID of the display where the notification is displayed. Possible values are 0 and 1. |
Example scenario
# luna-send -i -f -a com.webos.surfacemanager luna://com.webos.notification/getToastNotification '{"subscribe":true}
Response:
{
"subscribed": true,
"returnValue": true
}
Subscription response:
{
"iconUrl":" [file:///usr/palm/notificationmgr/images/toast-notification-icon.png] ",
"onlyToast":true,
"iconPath":"/usr/palm/notificationmgr/images/toast-notification-icon.png",
"readStatus":false,
"isSysReq":false,
"message":"hello world",
"sourceId":"com.webos.app.test",
"isCradleReq":false,
"_kind":"com.webos.notificationhistory:1",
"schedule":{
"expire":1692788497
},
"type":"standard",
"title":"",
"user":"guest",
"timesource":"ntp",
"displayId":0,
"timestamp":"1690196497182",
"returnValue":true,
"action":{
"launchParams":{
"id":"com.webos.app.test"
},
"serviceURI":"palm://com.webos.applicationManager/",
"serviceMethod":"launch"
}
}
API level 12
Removes all notifications that are currently being displayed.
Name | Required | Type | Description |
---|---|---|---|
displayId | Optional | Number | Identifier of the display where the notification is to be displayed. Possible values are 0 and 1. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
removeAllNotiId | Optional | Boolean | Indicates whether all notifications were removed successfully. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
displayId | Optional | Number | Identifier of the display where the notification is to be displayed. Possible values are 0 and 1. |
Error Code | Error Text | Error Description |
---|---|---|
None | Permission Denied | This error message implies that calling App or source is not previleged source for this method. Only SystemUI component is allowed to call this method. |
Example scenario
# luna-send -a com.webos.surfacemanager -n 1 luna://com.webos.notification/removeAllNotification '{"displayId": 0}'
Response:
{
"removeAllNotiId":true,
"returnValue":true
}
API level 21
Deletes the given notification(s) from DB. We can remove given set of notifications or remove all notifications from a given sourceId.
Name | Required | Type | Description |
---|---|---|---|
removeNotiId | Optional | String array | A list of IDs of the notifications to be deleted. Notification ID is composed of the URI of the notification source, a dash, and the timestamp of the time when the notification was issued. Format: "Source URI-Timestamp" Example "com.webos.surfacemanager-1393548223764" Note: Either one of "removeNotiId" or "sourceId" is mandatory to be provided. |
sourceId | Optional | String | Identifies the app or service that created the notification to be deleted. Format: URI Note: Either one of "removeNotiId" or "sourceId" is mandatory to be provided. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
removeNotiId | Optional | String array | A list of IDs of the notification that has been deleted. Format: "Source URI-Timestamp" Example: "com.webos.surfacemanager-1393548223764" Note: Returned when "removeNotiId" is passed as input parameter |
sourceId | Optional | String | The app or service that created the notification that are deleted. Format: URI Example: "com.webos.surfacemanager" Note: Returned when "sourceId" is passed as input parameter |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
None | Message is not parsed | This message implies that a JSON message parsing error occured. One of the following situations can cause the parsing error:
|
None | input sourceId or removeNotiId parameter | This message implies that both sourceId and removeNotiId parameters are missing. At least one should be present. |
None | sourceId can't be empty | This message implies that given sourceId parameter does not have any value. It cannot be empty. |
None | Noti Id can't be Empty | This message implies that given NotiId is empty. |
Example : WIth removeNotiId provided
# luna-send -a com.webos.surfacemanager -n 1 -f luna://com.webos.notification/removeNotification '{"removeNotiId": ["com.sloy.jbnotif-1393548393417"]}'
Response:
{
"removeNotiId": [
"com.sloy.jbnotif-1393548393417"
],
"returnValue": true
}
Example : With sourceId provided
# luna-send -n 1 -f -a com.webos.surfacemanager luna://com.webos.notification/removeNotification '{"sourceId": "com.sloy.jbnotif"}'
Response:
{
"sourceId": "com.sloy.jbnotif",
"returnValue": true
}
API level 12
Specifies whether the toast is to be marked as read or unread.
Name | Required | Type | Description |
---|---|---|---|
toastId | Required | String | Indicates the unique ID of the toast created. |
readStatus | Required | Boolean | Indicates the status of a toast to be set by the user. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
toastId | Optional | String | Contains the unique ID of the toast created. |
readStatus | Optional | Boolean | Indicates the status of a toast set by the user. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
None | Failed to set status | Failed to set the read / unread status of the toast. |
Example code
# luna-send -i -f -a com.webos.app.notification luna://com.webos.notification/setToastStatus '{
"toastId" : "com.webos.app.notification-1584349101435",
"readStatus" : true
}'
Response:
{
"returnValue" : true,
"toastId" : "com.webos.app.notification-1584349101435",
"readStatus" : true
}
Contains detailed information of an activity which is fired by the Actvity Manager. This object is returned from the Activity Manager. For more details, see com.webos.service.activitymanager.
Name | Required | Type | Description |
---|---|---|---|
activityId | Required | Number (uint64_t) | Activity Id that is fired. |
Describes the action parameter for the toast.
Name | Required | Type | Description |
---|---|---|---|
launchParams | Required | Object | launchParams must be passed in the format below where "appid" is a string that contains the id of the app to be launched. { "id": "appid" } |
serviceMethod | Required | String | Contains the LS2 service method name. |
serviceURI | Required | String | Contains LS2 Service URI. |
Contains the alert information.
Name | Required | Type | Description |
---|---|---|---|
appId | Optional | String | App ID related to this alert. |
timeout | Optional | Number | Indicates milliseconds in time that the caller waits to dismiss an alert when the user does nothing. |
portType | Optional | String | Indicates port type. |
portName | Optional | String | Indicates port name. |
portIcon | Optional | String | Indicates port icon path. |
deviceName | Optional | String | Indicates device name. |
params | Optional | Object | Contains parameters when appId is launched. |
inputs | Optional | Object: input | Contains information about an input alert. |
onFailAction | Optional | Object | "onFailAction": { "launchParams": { "id": "com.webos.app.browser" }, "serviceMethod": "launch", "serviceURI": "com.webos.service.applicationmanager/" } |
sourceId | Optional | String | ID the application or service that created the alert notification. Format: URI Example: "com.webos.surfacemanager" |
displayId | Optional | Number | ID of the display where the notification is to be displayed. Possible values are 0 and 1. |
title | Optional | String | Title information to be displayed for the alert. |
message | Optional | String | Message to be displayed. |
iconUrl | Optional | String | File path to icon to be displayed. |
modal | Optional | Boolean | Indicates whether the alert is a modal or non-modal notification. Possible values are:
|
type | Optional | String | Defines the button type in the alert. Possible values are:
|
isSysReq | Optional | Boolean | Indicates whether the notification comes from an app or a system.
|
isNotiSave | Optional | Boolean | Indicate whether the notification saved or not. Possible values are:
|
onCloseAction | Optional | Object: onclose | Indicates the action to be performed when close an alert. |
buttons | Optional | Object array: button | Defines the button label, and onclick action. Button specification is given in an array. An example is: "buttons":[ |
alertId | Optional | String | The ID of the created alert notification. The ID is composed of the URI of the notification source, a dash, and the timestamp of the time when the notification was issued. Format: "Source URI-Timestamp" Example: "com.webos.surfacemanager-1393548223764" |
timestamp | Optional | String | Timestamp of the time when the notification was issued. It indicates epoch time as milliseconds. |
deviceIcon | Optional | String | Connected device icon file name. |
Contains alert button information
Name | Required | Type | Description |
---|---|---|---|
label | Required | String | The text on the button. |
onclick | Optional | String | Luna API to be called when a button is clicked. |
onClick | Optional | String | Same as onclick. |
params | Optional | Object | Parameters for a service call. |
buttonType | Optional | String | The type of the button. It can be either ok or cancel. |
focus | Optional | Boolean | Set to true if button has default focus. |
Defines extra toast image.
Name | Required | Type | Description |
---|---|---|---|
uri | Optional | String | Image resource URI. |
Action to be performed on failure to create alert.
Name | Required | Type | Description |
---|---|---|---|
serviceURI | Required | String | URI to be called on failure to create alert. |
serviceMethod | Required | String | Method to be called on failure to create alert. |
launchParams | Required | Object | Parameters to be passed when URI (specified above) is called. |
Contains action information when a user clicks the toast
Name | Required | Type | Description |
---|---|---|---|
appId | Optional | String | Application Id to be launched |
params | Optional | Object | Contains parameters when appId is launched. |
Contains close action when alert is closed with close button or automatically
Name | Required | Type | Description |
---|---|---|---|
uri | Optional | String | Luna API to be called when an alert window is closed. |
params | Optional | Object | Contains parameters to be passed when uri is called. |
Action to be performed on failure to create alert from view side (LSM).
Name | Required | Type | Description |
---|---|---|---|
uri | Required | String | Luna API to be called when an alert window is closed. |
params | Required | Object | Parameters for the above URI. |
Creates a toast notification as a persistent message and define its schedule.
Name | Required | Type | Description |
---|---|---|---|
expire | Optional | Number (int64_t) | If this field is set, the created persistent message will be automatically removed after the specified amount of time has passed. The value should be the number of seconds that have elapsed since 00:00:00 UTC, 1 Jan 1970. |
Contains information about the stored toasts
Name | Required | Type | Description |
---|---|---|---|
displayId | Required | Number | Identifier of the display where the notification is displayed. Possible values are 0 and 1 |
sourceId | Required | String | Contains the source Id of the requester |
toastId | Required | String | Contains the unique ID of the toast created |
timestamp | Required | String | Time stamp string. It indicates epoch time as milliseconds |
iconUrl | Required | String | Contains the file path to icon to be displayed |
iconPath | Required | String | Describe icon path. It should be absoulte local file system path |
title | Required | String | Contains the title information to be displayed for the toast |
message | Required | String | Indicates the toast message. |
isSysReq | Required | Boolean | Indicates whether the notification comes from an app or system
|
schedule | Required | Object: schedule | Describe toast schedule. |
type | Required | String | Indicates the type of the toast message |
readStatus | Required | Boolean | Indicates whether the toast is read by the user or still unread
|
action | Required | Object: action | Contains the on-click action parameter. |
Error Code | Error Text | Error Description |
---|---|---|
100 | Message is not parsed | This message implies that a JSON message parsing error occurred. One of the following situations can cause the parsing error:
|
103 | Unknown Source | This message implies that the system was unable to retrieve the app's sourceId from the system bus message. |
104 | Permission Denied | This message implies that the app does not have permission to create system alerts. |
105 | Message can't be empty | This message implies that the field message in the request message is empty. |
106 | Invalid Service Uri in the onclick | This message implies that the service URI given in the onclick object is invalid. |
Contents