initialize method

Future<void> initialize({
  1. required SubscriptionHandler onNewSubscriptionHandler,
})

Implementation

Future<void> initialize({
  required SubscriptionHandler onNewSubscriptionHandler,
}) {
  _onNewSubscriptionHandler = onNewSubscriptionHandler;

  CommonChannel.setMethodCallHandler(_handleChannelMethodCallback);
  return CommonChannel.invokeMethod<void>(
    method: ChannelMethod.initialize,
    arguments: options
  ).catchError(
    (error) {
      if (error is! TimeoutException) throw error;
    },
  );
}