notifyChange abstract method
- @Deprecated("Use [NotificationService.notify]")
- 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
orNotificationParams.atKey.sharedBy
- Throws AtClientException when keys to encrypt the data are not found.
- Throws AtClientException when
notificationParams.notifier
is null whennotificationParams.strategy
is set to latest. - Throws AtClientException when fails to connect to cloud secondary server.
e.g alice is the current atsign
- 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);
- 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);
- 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);
- 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);
Implementation
@Deprecated("Use [NotificationService.notify]")
Future<String?> notifyChange(NotificationParams notificationParams);