notifyChange abstract method

  1. @Deprecated("Use [NotificationService.notify]")
Future<String?> notifyChange(
  1. NotificationParams notificationParams
)

Notifies the NotificationParams.atKey to notificationParams.atKey.sharedWith user of the atSign. Optionally, operation, value and metadata can be set along with key to notify.

  • Throws LateInitializationError when NotificationParams.atKey is not initialized
  • Throws AtKeyException when invalid NotificationParams.atKey.key is formed or when invalid metadata is provided.
  • Throws InvalidAtSignException on invalid NotificationParams.atKey.sharedWith or NotificationParams.atKey.sharedBy
  • Throws AtClientException when keys to encrypt the data are not found.
  • Throws AtClientException when notificationParams.notifier is null when notificationParams.strategy is set to latest.
  • Throws AtClientException when fails to connect to cloud secondary server.

e.g alice is the current atsign

  1. To notify a update of key to @bob
  var key = AtKey()..key='phone'
                   ..sharedWith='@bob'
  var notificationParams = NotificationParams().._atKey = key
                                               .._operation = OperationEnum.update
                                               .._messageType = MessageTypeEnum.key;
  notifyChange(notificationParams);
  1. To notify and cache a key - value in @bob
  var metaData = Metadata()..ttr='6000000';
  var key = AtKey()..key='phone'
                   ..sharedWith='@bob'
                   ..metadata=metaData
  var value='+1 999 9999'
  var notificationParams = NotificationParams().._atKey = key
                                               .._operation = OperationEnum.update
                                               .._value = value
                                               .._messageType = MessageTypeEnum.key;
  notifyChange(notificationParams);
  1. To notify a text message
  var key = AtKey()..key='phone'
                   ..sharedWith='@bob'
  var notificationParams = NotificationParams().._atKey = key
                                               .._operation = OperationEnum.update
                                               .._messageType = MessageTypeEnum.text;
  notifyChange(notificationParams);
  1. To notify a deletion of a key to @bob.
  var key = AtKey()..key='phone'
                   ..sharedWith='@bob'
  var notificationParams = NotificationParams().._atKey = key
                                               .._operation = OperationEnum.delete
                                               .._messageType = MessageTypeEnum.key;
  notifyChange(notificationParams);

Deprecated Use NotificationService.notify

Implementation

@Deprecated("Use [NotificationService.notify]")
Future<String?> notifyChange(NotificationParams notificationParams);