getSubscription method

Future<Map<String, dynamic>?> getSubscription({
  1. required String topic,
  2. required String subscriber,
})

getSubscription RPC gets the subscription details of a subscriber in a topic.

Implementation

Future<Map<String, dynamic>?> getSubscription({required String topic, required String subscriber}) async {
  try {
    Map? resp = await _methodChannel.invokeMethod('getSubscription', {
      '_id': this.address,
      'topic': topic,
      'subscriber': subscriber,
    });
    if (resp == null) {
      return null;
    }
    return Map<String, dynamic>.from(resp);
  } catch (e) {
    rethrow;
  }
}