setCatapushStateDelegate method

void setCatapushStateDelegate(
  1. CatapushStateDelegate delegate
)

Sets the delegate that will be informed of all state change events of the native SDK.

Implementation

void setCatapushStateDelegate(CatapushStateDelegate delegate) {
  _catapushStateDelegate = delegate;

  _stateSubscription?.cancel();
  _stateSubscription =
      _stateSubject.listen(_catapushStateDelegate?.catapushStateChanged);

  _errorQueueSubscription?.cancel();
  _errorQueueSubscription =
      _errorQueueSubject.listen(_catapushStateDelegate?.catapushHandleError);
}