unsubscribe method

  1. @override
Future<void> unsubscribe(
  1. String subscriptionId
)
override

Unsubscribes from a real-time event subscription.

subscriptionId is the ID returned by subscribeToEvents.

Throws EventLogException if the operation fails.

Implementation

@override
Future<void> unsubscribe(String subscriptionId) async {
  try {
    await methodChannel.invokeMethod<void>('unsubscribe', {
      'subscriptionId': subscriptionId,
    });
    await _subscriptionControllers.remove(subscriptionId)?.close();
    _stopListeningIfIdle();
  } on PlatformException catch (e) {
    throw _handlePlatformException(e);
  }
}