From 682e1cd6be4bc5cfb3e9b346dda85882325fc632 Mon Sep 17 00:00:00 2001 From: jguz-pubnub Date: Wed, 10 Dec 2025 14:59:27 +0100 Subject: [PATCH 1/8] KMPLogLevel --- PubNub.xcodeproj/project.pbxproj | 4 ++ Sources/PubNub/KMP/KMPPubNub.swift | 39 +++++++++++++++++++ Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift | 35 +++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift diff --git a/PubNub.xcodeproj/project.pbxproj b/PubNub.xcodeproj/project.pbxproj index d4c37b51..46cc529b 100644 --- a/PubNub.xcodeproj/project.pbxproj +++ b/PubNub.xcodeproj/project.pbxproj @@ -445,6 +445,7 @@ 3D867D1D2E422E6E00B03EEE /* KMPPAMToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D867D1C2E422E6E00B03EEE /* KMPPAMToken.swift */; }; 3D8BAC102B8C96D70059A5C3 /* DependencyContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8BAC0F2B8C96D70059A5C3 /* DependencyContainer.swift */; }; 3D9134972A1216F7000A5124 /* PubNubPushTargetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9134962A1216F7000A5124 /* PubNubPushTargetTests.swift */; }; + 3D9DCEE92EE9AF1C00F8B43D /* KMPLogLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9DCEE82EE9AF1C00F8B43D /* KMPLogLevel.swift */; }; 3DA04F2A2EA8C271007F5733 /* PresenceInputTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DA04F292EA8C271007F5733 /* PresenceInputTests.swift */; }; 3DA0C7C92BFDF538000FFE6C /* KMPPubNub.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DA0C7C82BFDF538000FFE6C /* KMPPubNub.swift */; }; 3DA0C7D02BFE59AC000FFE6C /* SubscriptionListenersContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DA0C7CF2BFE59AC000FFE6C /* SubscriptionListenersContainer.swift */; }; @@ -1077,6 +1078,7 @@ 3D867D1C2E422E6E00B03EEE /* KMPPAMToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPPAMToken.swift; sourceTree = ""; }; 3D8BAC0F2B8C96D70059A5C3 /* DependencyContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DependencyContainer.swift; sourceTree = ""; }; 3D9134962A1216F7000A5124 /* PubNubPushTargetTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PubNubPushTargetTests.swift; sourceTree = ""; }; + 3D9DCEE82EE9AF1C00F8B43D /* KMPLogLevel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPLogLevel.swift; sourceTree = ""; }; 3DA04F292EA8C271007F5733 /* PresenceInputTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PresenceInputTests.swift; sourceTree = ""; }; 3DA0C7C82BFDF538000FFE6C /* KMPPubNub.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMPPubNub.swift; sourceTree = ""; }; 3DA0C7CF2BFE59AC000FFE6C /* SubscriptionListenersContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionListenersContainer.swift; sourceTree = ""; }; @@ -2090,6 +2092,7 @@ 3D339C772BFF826500197342 /* Wrappers */ = { isa = PBXGroup; children = ( + 3D9DCEE82EE9AF1C00F8B43D /* KMPLogLevel.swift */, 84AE887D2C0D9CFA009FB148 /* KMPAnyJSON.swift */, 3D339C742BFF826500197342 /* KMPEventListener.swift */, 3DB2C4862C0F4B250060B8CF /* KMPStatusListener.swift */, @@ -3790,6 +3793,7 @@ 35E4604F234B8B9D005D04AE /* ErrorDescription.swift in Sources */, 35089A0922E3C08D002BCC94 /* Error+PubNub.swift in Sources */, 3534D4E422C57659008E89FA /* PublishRouter.swift in Sources */, + 3D9DCEE92EE9AF1C00F8B43D /* KMPLogLevel.swift in Sources */, 35EE358C22E26A4D00E3F081 /* HTTPURLResponse+PubNub.swift in Sources */, 3DB692522D555AA5006702DC /* Logger.swift in Sources */, 3D389FEE2B35AF4A006928E7 /* SubscribeTransition.swift in Sources */, diff --git a/Sources/PubNub/KMP/KMPPubNub.swift b/Sources/PubNub/KMP/KMPPubNub.swift index da51536c..0d093155 100644 --- a/Sources/PubNub/KMP/KMPPubNub.swift +++ b/Sources/PubNub/KMP/KMPPubNub.swift @@ -104,6 +104,35 @@ public extension KMPPubNub { } } +// MARK: - LogLevel + +@objc public extension KMPPubNub { + var logLevel: KMPLogLevel { + get { + switch pubnub.logLevel { + case .none: + return .none + case .trace: + return KMPLogLevel.trace + case .debug: + return KMPLogLevel.debug + case .info: + return KMPLogLevel.info + case .event: + return KMPLogLevel.event + case .error: + return KMPLogLevel.error + case .all: + return KMPLogLevel.all + default: + return KMPLogLevel.none + } + } set { + pubnub.logLevel = LogLevel(rawValue: newValue.rawValue) + } + } +} + // MARK: - Configuration @objc @@ -123,4 +152,14 @@ public class KMPPubNubConfiguration: NSObject { public var authKey: String? { configuration.authKey } + + @objc + public var subscribeKey: String { + configuration.subscribeKey + } + + @objc + public var publishKey: String? { + configuration.publishKey + } } diff --git a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift new file mode 100644 index 00000000..f6448b57 --- /dev/null +++ b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift @@ -0,0 +1,35 @@ +// +// KMPLogLevel.swift +// +// Copyright (c) PubNub Inc. +// All rights reserved. +// +// This source code is licensed under the license found in the +// LICENSE file in the root directory of this source tree. +// +// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK +// +// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks. +// While these symbols are public, they are intended strictly for internal usage. +// +// External developers should refrain from directly using these symbols in their code, as their implementation details +// may change in future versions of the framework, potentially leading to breaking changes. + +import Foundation + +@objc public class KMPLogLevel: NSObject { + static let none: KMPLogLevel = .init(rawValue: 0) + static let trace: KMPLogLevel = .init(rawValue: 1 << 0) + static let debug: KMPLogLevel = .init(rawValue: 1 << 1) + static let info: KMPLogLevel = .init(rawValue: 1 << 2) + static let event: KMPLogLevel = .init(rawValue: 1 << 3) + static let warn: KMPLogLevel = .init(rawValue: 1 << 4) + static let error: KMPLogLevel = .init(rawValue: 1 << 5) + static let all: KMPLogLevel = .init(rawValue: UInt32.max) + + var rawValue: UInt32 + + public init(rawValue: UInt32) { + self.rawValue = rawValue + } +} From a0bc8a93dd7693a6277b6276477eddbf9377e99b Mon Sep 17 00:00:00 2001 From: jguz-pubnub Date: Thu, 11 Dec 2025 11:07:31 +0100 Subject: [PATCH 2/8] KMPLogLevel --- Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift index f6448b57..cc1ba0c5 100644 --- a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift +++ b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift @@ -18,14 +18,14 @@ import Foundation @objc public class KMPLogLevel: NSObject { - static let none: KMPLogLevel = .init(rawValue: 0) - static let trace: KMPLogLevel = .init(rawValue: 1 << 0) - static let debug: KMPLogLevel = .init(rawValue: 1 << 1) - static let info: KMPLogLevel = .init(rawValue: 1 << 2) - static let event: KMPLogLevel = .init(rawValue: 1 << 3) - static let warn: KMPLogLevel = .init(rawValue: 1 << 4) - static let error: KMPLogLevel = .init(rawValue: 1 << 5) - static let all: KMPLogLevel = .init(rawValue: UInt32.max) + @objc static let none: KMPLogLevel = .init(rawValue: 0) + @objc static let trace: KMPLogLevel = .init(rawValue: 1 << 0) + @objc static let debug: KMPLogLevel = .init(rawValue: 1 << 1) + @objc static let info: KMPLogLevel = .init(rawValue: 1 << 2) + @objc static let event: KMPLogLevel = .init(rawValue: 1 << 3) + @objc static let warn: KMPLogLevel = .init(rawValue: 1 << 4) + @objc static let error: KMPLogLevel = .init(rawValue: 1 << 5) + @objc static let all: KMPLogLevel = .init(rawValue: UInt32.max) var rawValue: UInt32 From 7006711a285c03bf648a5e9d4de8bc98d89c4750 Mon Sep 17 00:00:00 2001 From: jguz-pubnub Date: Thu, 11 Dec 2025 12:08:22 +0100 Subject: [PATCH 3/8] KMPLogLevel (2) --- Sources/PubNub/KMP/KMPPubNub.swift | 19 +------------------ Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift | 18 +++++++++--------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/Sources/PubNub/KMP/KMPPubNub.swift b/Sources/PubNub/KMP/KMPPubNub.swift index 0d093155..fc772c16 100644 --- a/Sources/PubNub/KMP/KMPPubNub.swift +++ b/Sources/PubNub/KMP/KMPPubNub.swift @@ -109,24 +109,7 @@ public extension KMPPubNub { @objc public extension KMPPubNub { var logLevel: KMPLogLevel { get { - switch pubnub.logLevel { - case .none: - return .none - case .trace: - return KMPLogLevel.trace - case .debug: - return KMPLogLevel.debug - case .info: - return KMPLogLevel.info - case .event: - return KMPLogLevel.event - case .error: - return KMPLogLevel.error - case .all: - return KMPLogLevel.all - default: - return KMPLogLevel.none - } + KMPLogLevel(rawValue: pubnub.logLevel.rawValue) } set { pubnub.logLevel = LogLevel(rawValue: newValue.rawValue) } diff --git a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift index cc1ba0c5..0bcacac1 100644 --- a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift +++ b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift @@ -18,16 +18,16 @@ import Foundation @objc public class KMPLogLevel: NSObject { - @objc static let none: KMPLogLevel = .init(rawValue: 0) - @objc static let trace: KMPLogLevel = .init(rawValue: 1 << 0) - @objc static let debug: KMPLogLevel = .init(rawValue: 1 << 1) - @objc static let info: KMPLogLevel = .init(rawValue: 1 << 2) - @objc static let event: KMPLogLevel = .init(rawValue: 1 << 3) - @objc static let warn: KMPLogLevel = .init(rawValue: 1 << 4) - @objc static let error: KMPLogLevel = .init(rawValue: 1 << 5) - @objc static let all: KMPLogLevel = .init(rawValue: UInt32.max) + @objc public static let none: KMPLogLevel = .init(rawValue: 0) + @objc public static let trace: KMPLogLevel = .init(rawValue: 1 << 0) + @objc public static let debug: KMPLogLevel = .init(rawValue: 1 << 1) + @objc public static let info: KMPLogLevel = .init(rawValue: 1 << 2) + @objc public static let event: KMPLogLevel = .init(rawValue: 1 << 3) + @objc public static let warn: KMPLogLevel = .init(rawValue: 1 << 4) + @objc public static let error: KMPLogLevel = .init(rawValue: 1 << 5) + @objc public static let all: KMPLogLevel = .init(rawValue: UInt32.max) - var rawValue: UInt32 + @objc public var rawValue: UInt32 public init(rawValue: UInt32) { self.rawValue = rawValue From 49b0cd3edb31d728e84eaf3950303a060bf13c43 Mon Sep 17 00:00:00 2001 From: jguz-pubnub Date: Thu, 11 Dec 2025 12:32:53 +0100 Subject: [PATCH 4/8] KMPLogLevel (3) --- Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift index 0bcacac1..e25a29f0 100644 --- a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift +++ b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift @@ -18,18 +18,9 @@ import Foundation @objc public class KMPLogLevel: NSObject { - @objc public static let none: KMPLogLevel = .init(rawValue: 0) - @objc public static let trace: KMPLogLevel = .init(rawValue: 1 << 0) - @objc public static let debug: KMPLogLevel = .init(rawValue: 1 << 1) - @objc public static let info: KMPLogLevel = .init(rawValue: 1 << 2) - @objc public static let event: KMPLogLevel = .init(rawValue: 1 << 3) - @objc public static let warn: KMPLogLevel = .init(rawValue: 1 << 4) - @objc public static let error: KMPLogLevel = .init(rawValue: 1 << 5) - @objc public static let all: KMPLogLevel = .init(rawValue: UInt32.max) + @objc public private(set) var rawValue: UInt32 - @objc public var rawValue: UInt32 - - public init(rawValue: UInt32) { + @objc public init(rawValue: UInt32) { self.rawValue = rawValue } } From 49164c6925c611956f9f859e9d018cb9c2ad02a2 Mon Sep 17 00:00:00 2001 From: jguz-pubnub Date: Thu, 11 Dec 2025 13:16:06 +0100 Subject: [PATCH 5/8] KMPLogLevel (4) --- Sources/PubNub/KMP/KMPPubNub.swift | 11 +++-------- Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift | 13 +++++++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Sources/PubNub/KMP/KMPPubNub.swift b/Sources/PubNub/KMP/KMPPubNub.swift index fc772c16..ebc12314 100644 --- a/Sources/PubNub/KMP/KMPPubNub.swift +++ b/Sources/PubNub/KMP/KMPPubNub.swift @@ -31,14 +31,9 @@ public class KMPPubNub: NSObject { } @objc - public init(user: String, subKey: String, pubKey: String) { - self.pubnub = PubNub( - configuration: PubNubConfiguration( - publishKey: pubKey, - subscribeKey: subKey, - userId: user - ) - ) + public init(user: String, subKey: String, pubKey: String, logLevel: KMPLogLevel = .none) { + self.pubnub = PubNub(configuration: .init(publishKey: pubKey, subscribeKey: subKey, userId: user)) + self.pubnub.logLevel = logLevel.toLogLevel() self.configObjC = KMPPubNubConfiguration(configuration: self.pubnub.configuration) super.init() } diff --git a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift index e25a29f0..1eebaaa0 100644 --- a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift +++ b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift @@ -18,9 +18,22 @@ import Foundation @objc public class KMPLogLevel: NSObject { + @objc public static let none: KMPLogLevel = .init(rawValue: 0) + @objc public static let trace: KMPLogLevel = .init(rawValue: 1 << 0) + @objc public static let debug: KMPLogLevel = .init(rawValue: 1 << 1) + @objc public static let info: KMPLogLevel = .init(rawValue: 1 << 2) + @objc public static let event: KMPLogLevel = .init(rawValue: 1 << 3) + @objc public static let warn: KMPLogLevel = .init(rawValue: 1 << 4) + @objc public static let error: KMPLogLevel = .init(rawValue: 1 << 5) + @objc public static let all: KMPLogLevel = .init(rawValue: UInt32.max) + @objc public private(set) var rawValue: UInt32 @objc public init(rawValue: UInt32) { self.rawValue = rawValue } + + func toLogLevel() -> LogLevel { + LogLevel(rawValue: rawValue) + } } From b92429bb81c30bc51ab168eb392eaeb5640ca94f Mon Sep 17 00:00:00 2001 From: jguz-pubnub Date: Thu, 11 Dec 2025 13:38:53 +0100 Subject: [PATCH 6/8] KMPLogLevel (5) --- Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift index 1eebaaa0..91a80d86 100644 --- a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift +++ b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift @@ -18,14 +18,14 @@ import Foundation @objc public class KMPLogLevel: NSObject { - @objc public static let none: KMPLogLevel = .init(rawValue: 0) - @objc public static let trace: KMPLogLevel = .init(rawValue: 1 << 0) - @objc public static let debug: KMPLogLevel = .init(rawValue: 1 << 1) - @objc public static let info: KMPLogLevel = .init(rawValue: 1 << 2) - @objc public static let event: KMPLogLevel = .init(rawValue: 1 << 3) - @objc public static let warn: KMPLogLevel = .init(rawValue: 1 << 4) - @objc public static let error: KMPLogLevel = .init(rawValue: 1 << 5) - @objc public static let all: KMPLogLevel = .init(rawValue: UInt32.max) + @objc public static let none: KMPLogLevel = .init(rawValue: LogLevel.none.rawValue) + @objc public static let trace: KMPLogLevel = .init(rawValue: LogLevel.info.rawValue) + @objc public static let debug: KMPLogLevel = .init(rawValue: LogLevel.debug.rawValue) + @objc public static let info: KMPLogLevel = .init(rawValue: LogLevel.info.rawValue) + @objc public static let event: KMPLogLevel = .init(rawValue: LogLevel.event.rawValue) + @objc public static let warn: KMPLogLevel = .init(rawValue: LogLevel.warn.rawValue) + @objc public static let error: KMPLogLevel = .init(rawValue: LogLevel.error.rawValue) + @objc public static let all: KMPLogLevel = .init(rawValue: LogLevel.all.rawValue) @objc public private(set) var rawValue: UInt32 From 36624ed32b1195c94d23726c75a65fc7633fc015 Mon Sep 17 00:00:00 2001 From: jguz-pubnub Date: Thu, 11 Dec 2025 13:39:25 +0100 Subject: [PATCH 7/8] KMPLogLevel (6) --- Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift index 91a80d86..32062eda 100644 --- a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift +++ b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift @@ -19,7 +19,7 @@ import Foundation @objc public class KMPLogLevel: NSObject { @objc public static let none: KMPLogLevel = .init(rawValue: LogLevel.none.rawValue) - @objc public static let trace: KMPLogLevel = .init(rawValue: LogLevel.info.rawValue) + @objc public static let trace: KMPLogLevel = .init(rawValue: LogLevel.trace.rawValue) @objc public static let debug: KMPLogLevel = .init(rawValue: LogLevel.debug.rawValue) @objc public static let info: KMPLogLevel = .init(rawValue: LogLevel.info.rawValue) @objc public static let event: KMPLogLevel = .init(rawValue: LogLevel.event.rawValue) From 509125461f59aa7d707d4cbb5f89a7a6d593ea91 Mon Sep 17 00:00:00 2001 From: Jakub Guz Date: Thu, 11 Dec 2025 16:35:47 +0000 Subject: [PATCH 8/8] PubNub SDK 10.1.1 release. --- .pubnub.yml | 9 +++++++-- PubNub.xcodeproj/project.pbxproj | 16 ++++++++-------- PubNubSwift.podspec | 2 +- Sources/PubNub/Helpers/Constants.swift | 2 +- Sources/PubNub/KMP/KMPPubNub.swift | 12 ++++++++---- Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift | 13 ------------- 6 files changed, 25 insertions(+), 29 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 1c25fbed..109fcbc8 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,9 +1,14 @@ --- name: swift scm: github.com/pubnub/swift -version: "10.1.0" +version: "10.1.1" schema: 1 changelog: + - date: 2025-12-11 + version: 10.1.1 + changes: + - type: feature + text: "Expose logLevel property in the Objective-C layer for KMP (internal use)." - date: 2025-11-13 version: 10.1.0 changes: @@ -754,7 +759,7 @@ sdks: - distribution-type: source distribution-repository: GitHub release package-name: PubNub - location: https://github.com/pubnub/swift/archive/refs/tags/10.1.0.zip + location: https://github.com/pubnub/swift/archive/refs/tags/10.1.1.zip supported-platforms: supported-operating-systems: macOS: diff --git a/PubNub.xcodeproj/project.pbxproj b/PubNub.xcodeproj/project.pbxproj index 46cc529b..7cae9220 100644 --- a/PubNub.xcodeproj/project.pbxproj +++ b/PubNub.xcodeproj/project.pbxproj @@ -4075,7 +4075,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 10.1.0; + MARKETING_VERSION = 10.1.1; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17"; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -4126,7 +4126,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 10.1.0; + MARKETING_VERSION = 10.1.1; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17"; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -4234,7 +4234,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 10.1.0; + MARKETING_VERSION = 10.1.1; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17"; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -4287,7 +4287,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 10.1.0; + MARKETING_VERSION = 10.1.1; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17"; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -4408,7 +4408,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 10.1.0; + MARKETING_VERSION = 10.1.1; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17"; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -4460,7 +4460,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 10.1.0; + MARKETING_VERSION = 10.1.1; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17"; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -4940,7 +4940,7 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 10.1.0; + MARKETING_VERSION = 10.1.1; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++14"; OTHER_CFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; @@ -4983,7 +4983,7 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 10.1.0; + MARKETING_VERSION = 10.1.1; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++14"; OTHER_CFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; diff --git a/PubNubSwift.podspec b/PubNubSwift.podspec index da47f0d2..bbf04abe 100644 --- a/PubNubSwift.podspec +++ b/PubNubSwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'PubNubSwift' - s.version = '10.1.0' + s.version = '10.1.1' s.homepage = 'https://github.com/pubnub/swift' s.documentation_url = 'https://www.pubnub.com/docs/swift-native/pubnub-swift-sdk' s.authors = { 'PubNub, Inc.' => 'support@pubnub.com' } diff --git a/Sources/PubNub/Helpers/Constants.swift b/Sources/PubNub/Helpers/Constants.swift index 8240788d..e6e88c7c 100644 --- a/Sources/PubNub/Helpers/Constants.swift +++ b/Sources/PubNub/Helpers/Constants.swift @@ -57,7 +57,7 @@ public enum Constant { static let pubnubSwiftSDKName: String = "PubNubSwift" - static let pubnubSwiftSDKVersion: String = "10.1.0" + static let pubnubSwiftSDKVersion: String = "10.1.1" static let appBundleId: String = { if let info = Bundle.main.infoDictionary, diff --git a/Sources/PubNub/KMP/KMPPubNub.swift b/Sources/PubNub/KMP/KMPPubNub.swift index ebc12314..4d92d36a 100644 --- a/Sources/PubNub/KMP/KMPPubNub.swift +++ b/Sources/PubNub/KMP/KMPPubNub.swift @@ -31,10 +31,14 @@ public class KMPPubNub: NSObject { } @objc - public init(user: String, subKey: String, pubKey: String, logLevel: KMPLogLevel = .none) { - self.pubnub = PubNub(configuration: .init(publishKey: pubKey, subscribeKey: subKey, userId: user)) - self.pubnub.logLevel = logLevel.toLogLevel() - self.configObjC = KMPPubNubConfiguration(configuration: self.pubnub.configuration) + public init(user: String, subKey: String, pubKey: String, logLevel: KMPLogLevel) { + self.pubnub = PubNub( + configuration: .init(publishKey: pubKey, subscribeKey: subKey, userId: user), + logger: .init(levels: LogLevel(rawValue: logLevel.rawValue)) + ) + self.configObjC = KMPPubNubConfiguration( + configuration: pubnub.configuration + ) super.init() } } diff --git a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift index 32062eda..e25a29f0 100644 --- a/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift +++ b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift @@ -18,22 +18,9 @@ import Foundation @objc public class KMPLogLevel: NSObject { - @objc public static let none: KMPLogLevel = .init(rawValue: LogLevel.none.rawValue) - @objc public static let trace: KMPLogLevel = .init(rawValue: LogLevel.trace.rawValue) - @objc public static let debug: KMPLogLevel = .init(rawValue: LogLevel.debug.rawValue) - @objc public static let info: KMPLogLevel = .init(rawValue: LogLevel.info.rawValue) - @objc public static let event: KMPLogLevel = .init(rawValue: LogLevel.event.rawValue) - @objc public static let warn: KMPLogLevel = .init(rawValue: LogLevel.warn.rawValue) - @objc public static let error: KMPLogLevel = .init(rawValue: LogLevel.error.rawValue) - @objc public static let all: KMPLogLevel = .init(rawValue: LogLevel.all.rawValue) - @objc public private(set) var rawValue: UInt32 @objc public init(rawValue: UInt32) { self.rawValue = rawValue } - - func toLogLevel() -> LogLevel { - LogLevel(rawValue: rawValue) - } }