onDataEncryptionKeyChanged method

Stream<bool?> onDataEncryptionKeyChanged()

This method is called to register a listener for data key changes.

If the data key of one device is updated for a user with multiple devices, the cloud will notify the user to update data keys on other devices.

Implementation

Stream<bool?> onDataEncryptionKeyChanged() {
  try {
    return _onDataEncryptionKeyChangeEventChannel
        .receiveBroadcastStream()
        .map((dynamic s) {
      return s is bool ? s : null;
    });
  } catch (e) {
    throw AGConnectCloudDBException._from(e);
  }
}