addCommandListener method

Future<void> addCommandListener(
  1. void callback(
    1. Command<String> response
    ), {
  2. void onError(
    1. String error
    )?,
})

Implementation

Future<void> addCommandListener(void callback(Command<String> response),
        {void onError(String error)?}) =>
    _methodChannel.invokeMethod(
        "Backendless.Messaging.Channel.addCommandListener", {
      "channelHandle": _channelHandle
    }).then((handle) => BackendlessMessaging._commandCallbacks[handle] =
        new EventCallback(callback, onError));