diff --git a/Sources/PubNub/EventEngine/Subscribe/SubscribeTransition.swift b/Sources/PubNub/EventEngine/Subscribe/SubscribeTransition.swift index 70747648..e57e5726 100644 --- a/Sources/PubNub/EventEngine/Subscribe/SubscribeTransition.swift +++ b/Sources/PubNub/EventEngine/Subscribe/SubscribeTransition.swift @@ -30,7 +30,7 @@ class SubscribeTransition: TransitionProtocol { case .subscriptionRestored: return true case .unsubscribeAll: - return true + return !(state is Subscribe.UnsubscribedState) case .disconnect: return !( state is Subscribe.HandshakeStoppedState || state is Subscribe.ReceiveStoppedState || diff --git a/Sources/PubNub/Events/New/EventListenerInterface.swift b/Sources/PubNub/Events/New/EventListenerInterface.swift index acb314e7..4fc56e2d 100644 --- a/Sources/PubNub/Events/New/EventListenerInterface.swift +++ b/Sources/PubNub/Events/New/EventListenerInterface.swift @@ -28,7 +28,7 @@ public class StatusListener: StatusListenerInterface { public let queue: DispatchQueue public var onConnectionStateChange: ((ConnectionStatus) -> Void)? - init( + public init( uuid: UUID = UUID(), queue: DispatchQueue = .main, onConnectionStateChange: @escaping ((ConnectionStatus) -> Void) @@ -80,7 +80,7 @@ public class EventListener: EventListenerInterface { public var onFileEvent: ((PubNubFileChangeEvent) -> Void)? public var onAppContext: ((PubNubAppContextEvent) -> Void)? - init( + public init( queue: DispatchQueue = .main, uuid: UUID = UUID(), onEvent: ((PubNubEvent) -> Void)? = nil,