startMonitor method

  1. @override
Future<void> startMonitor(
  1. String privateKey,
  2. Function? notificationCallback, {
  3. String? regex,
})
override

Creates a monitor connection to atSign's cloud secondary server.Whenever a notification is created on the server, monitor receives the notification on the client. Optionally a regular expression and be passed to filter the notifications

Implementation

@override
Future<void> startMonitor(String privateKey, Function? notificationCallback,
    {String? regex}) async {
  var monitorVerbBuilder = MonitorVerbBuilder();
  if (regex != null) {
    monitorVerbBuilder.regex = regex;
  }
  await _remoteSecondary!.monitor(
      monitorVerbBuilder.buildCommand(), notificationCallback, privateKey);
}