diff --git a/Sources/PubNub/KMM/Wrappers/PubNubSubscriptionObjC.swift b/Sources/PubNub/KMM/Wrappers/PubNubSubscriptionObjC.swift index f1e86be4..c653c094 100644 --- a/Sources/PubNub/KMM/Wrappers/PubNubSubscriptionObjC.swift +++ b/Sources/PubNub/KMM/Wrappers/PubNubSubscriptionObjC.swift @@ -13,7 +13,6 @@ import Foundation @objc public class PubNubSubscriptionObjC: NSObject { let subscription: Subscription - let receivePresenceEvents: Bool @objc public var onMessage: ((PubNubMessageObjC) -> Void)? @objc public var onPresence: (([PubNubPresenceChangeObjC]) -> Void)? @@ -24,14 +23,15 @@ public class PubNubSubscriptionObjC: NSObject { @objc public init(entity: PubNubEntityRepresentableObjC, receivePresenceEvents: Bool) { - self.subscription = Subscription(entity: entity.entity) - self.receivePresenceEvents = receivePresenceEvents + self.subscription = Subscription( + entity: entity.entity, + options: receivePresenceEvents ? ReceivePresenceEvents() : .empty() + ) } @objc public init(entity: PubNubEntityRepresentableObjC) { self.subscription = Subscription(entity: entity.entity) - self.receivePresenceEvents = false } @objc @@ -89,8 +89,7 @@ public class PubNubSubscriptionObjC: NSObject { @objc public func append(subscription: PubNubSubscriptionObjC) -> PubNubSubscriptionSetObjC { let underlyingSubscription = Subscription( - entity: subscription.subscription.entity, - options: receivePresenceEvents ? ReceivePresenceEvents() : .empty() + entity: subscription.subscription.entity ) underlyingSubscription.onMessage = {