increaseMetaCounters method

Future<Map<String, int>> increaseMetaCounters(
  1. Map<String, int> metaCounters
)

Increases meta counters on this channel with metaCounters.

It returns Map<String, int> that newly updated. Once it completes successfully, channel event ChannelEventHandler.onMetaCountersUpdated will be invoked. Given values will be added to given keys.

before

{'key1' : 2}

increaseMetaCounters({'key1': 5})

after

{'key1': 7}

Implementation

Future<Map<String, int>> increaseMetaCounters(
    Map<String, int> metaCounters) async {
  if (metaCounters.isEmpty) {
    throw InvalidParameterError();
  }
  return _sdk.api.send(
    ChannelMetaCounterUpdateRequest(
      channelType: channelType,
      channelUrl: channelUrl,
      metaCounter: metaCounters,
      mode: MetaCounterMode.increase,
    ),
  );
}