showMessage
Command
Show one message as Notification or Popup If multiple message are sent, they are queued
BND_MESSAGE extra of an Intent with the action ACTION_RNC_BROADCAST, to BeNav's activity or receiver: see Sending commands.Puts text from the client application in front of the driver, inside BeNav, while they are navigating. It saves the driver switching applications to read something, and lets the client application say something urgent at the moment it matters.
Two forms: a notification banner at the top of the screen, which does not interrupt, and a popup in the middle, which blocks interaction until it is dealt with. The client application chooses how long it stays, whether the driver can dismiss it, whether it makes a sound, and its colours.
Worth knowing
- One message is shown at a time; further messages queue and appear in turn.
- A popup that is neither dismissible nor time-limited blocks the driver until the client
application sends
hideMessage. Deliberate for an acknowledgement, dangerous by accident.
Example: a change of plan mid-route
A customer cancels while the driver is already on the way. Dispatch sends a notification-style
message ("Drop 4 cancelled, continue to drop 5") which the driver reads without leaving
navigation, followed by a fresh startGuidance for the new destination.
Command#
{
"id": "string",
"jsonrpc": "2.0",
"method": "showMessage",
"params": {
"dismissible": true,
"expiresIn": 5,
"soundAlert": false,
"text": "Your message ",
"type": "notification",
"backgroundColor" : "#FF5722",
"textColor": "#2196F3"
}
}Specific parameters:
textText of the messagetype["notification" | "popup"]notificationMessage will be displayed at the top of the screenpopupMessage will be displayed in the middle of the screen, and make other elements non interactive
soundAlertShould a notification sound be sent when the message appearsdismissibleShould the message be dismissible by user through a close buttonexpiresInDuration the message will be displayed for.- if set to 0 the message will be displayed indefinitely
backgroundColorColor of the card the message is displayed intextColorColor of the message's text
text and type are mandatory; a blank text is rejected with -32602 invalid.params. expiresIn is expressed in seconds. Defaults: dismissible true, expiresIn 0 (indefinite), soundAlert false. type is matched case-insensitively.
If dismissible is set to false and expiresIn to 0, the message will only disappear after a call to hideMessage. Be careful as such a message with a type popup will block any action by the user until a call to hideMessage.
Only one (1) message can be displayed at a time. Multiple calls to this command will queue the subsequent messages: each will be displayed after the previous one disappear.
Response#
Generic responses