editUser method

Future<VIUserEvent> editUser(
  1. Map<String, Object>? customData,
  2. Map<String, Object>? privateCustomData
)

Edit current user information.

customData - New custom data. If null, previously set custom data will not be changed. If empty map, previously set custom data will be removed.

privateCustomData - New private custom data. If null, previously set private custom data will not be changed. If empty map, previously set private custom data will be removed.

Throws VIException, if operation failed, otherwise returns VIUserEvent instance. For all possible errors see VIMessagingError

Implementation

Future<VIUserEvent> editUser(
  Map<String, Object>? customData,
  Map<String, Object>? privateCustomData,
) async {
  try {
    Map<String, dynamic>? data =
        await _methodChannel.invokeMapMethod('Messaging.editUser', {
      'customData': customData,
      'privateCustomData': privateCustomData,
    });
    if (data == null) {
      _VILog._e('VIMessenger: editUser: data was null, skipping');
      throw VIException(
        VIMessagingError.ERROR_INTERNAL,
        'VIMessenger:editUser: data was null',
      );
    }
    return VIUserEvent._fromMap(data);
  } on PlatformException catch (e) {
    throw VIException(e.code, e.message);
  }
}