BeNav5RNC API
Android

setupNotifications

Command

Configures notifications to be received

Send this JSON-RPC message in the BND_MESSAGE extra of an Intent with the action ACTION_RNC_BROADCAST, to BeNav's activity or receiver: see Sending commands.

Chooses which events BeNav reports back. Notifications are the return channel of RNC: commands go one way, and everything that happens inside BeNav (progress, arrivals, the driver stopping guidance, an alert firing) comes back this way.

Most notifications are off until asked for, so a client application receives only what it subscribes to rather than filtering a stream it did not want. Some carry their own settings, such as how often progress may be reported.

Worth knowing

  • The setting is not persisted across a restart of BeNav: subscribe once per session.
  • A name BeNav does not recognise is rejected rather than ignored, so a typo is visible immediately instead of producing silence later.

The five guidance notifications below are disabled by default - use this command to enable them independently. onAppStatusChanged is enabled by default and can be switched off with the same command. onTraffic, onPoiClicked and the CircuitNav notifications are always on and cannot be configured.

json
{
  "id": "1",
  "jsonrpc": "2.0",
  "method": "setupNotifications",
  "params": {
    "notifications": [
      {
        "name": "onNavigationProgressChanged",
        "params": {
          "enabled": true,
          "minPeriod": 60,
          "waypointsInfo": true
        }
      },
      {
        "name": "onViaPointReached",
        "params": {
            "enabled": true
        }
      }
    ]
  }
}
  • notifications: Array of notifications.

Accepted name values are exactly: onNavigationProgressChanged, onViaPointReached, onDestinationReached, onGuidanceStopped, onVehicleProfileAlert, onVehicleStatusChanged and onAppStatusChanged. Any other name is rejected with -32700 parse.error.

Each notification configuration is specified in its dedicated section below.

Response#

json
{
  "id": "1",
  "jsonrpc": "2.0",
  "result": {}
}