BeNav5RNC API
Android

onAppStatusChanged

Notification

Notification when the application starts, is foregrounded, backgrounded or stopped (enabled by default)

A notification BeNav sends once you subscribe to it with setupNotifications. Your application receives it as described in Receiving messages.

Reports BeNav's own lifecycle: finished starting up, came to the foreground, went to the background, and shut down. It answers a question a client application otherwise has no way to ask: is BeNav running, and is the driver actually looking at it?

The startup event matters most in practice: it marks the moment BeNav is ready to accept commands, so a client application can wait for it rather than sending into a void and handling the refusal.

Worth knowing

  • Unlike the guidance notifications, this one is enabled by default. Turn it off with setupNotifications if it is not wanted.
  • The shutdown event is sent as BeNav exits, so a client application can tell a deliberate stop from a crash or a device going flat.

Configuration#

json
{
  "name":"onAppStatusChanged",
  "params": {
    "enabled": true
  }
}

Notification Data#

json
{
  "jsonrpc": "2.0",
  "method": "onAppStatusChanged",
  "params": {
    "event": "appInForeground"
  }
}
  • event one of startupComplete, appInForeground, appInBackground, appStopped. appStopped is emitted once as the application terminates - on a swipe-away, the quit dialog, or the stopApp command.