unsubscribe method

Future<VISubscriptionEvent> unsubscribe(
  1. List<int> users
)

Unsubscribe from other user(s) information and status changes.

It's possible to subscribe for any user of the main Voximplant developer account or its child accounts.

Other logged in clients (of the current user) can be informed about the unsubscription via the VIMessenger.onSubscribe callback. User(s) specified in the 'users' parameter aren't informed about the unsubscription.

users - List of IM user ids

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

Implementation

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