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 d4c37b51..7cae9220 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 */, @@ -4071,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; @@ -4122,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; @@ -4230,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; @@ -4283,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; @@ -4404,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; @@ -4456,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; @@ -4936,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)"; @@ -4979,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 da51536c..4d92d36a 100644 --- a/Sources/PubNub/KMP/KMPPubNub.swift +++ b/Sources/PubNub/KMP/KMPPubNub.swift @@ -31,15 +31,14 @@ public class KMPPubNub: NSObject { } @objc - public init(user: String, subKey: String, pubKey: String) { + public init(user: String, subKey: String, pubKey: String, logLevel: KMPLogLevel) { self.pubnub = PubNub( - configuration: PubNubConfiguration( - publishKey: pubKey, - subscribeKey: subKey, - userId: user - ) + configuration: .init(publishKey: pubKey, subscribeKey: subKey, userId: user), + logger: .init(levels: LogLevel(rawValue: logLevel.rawValue)) + ) + self.configObjC = KMPPubNubConfiguration( + configuration: pubnub.configuration ) - self.configObjC = KMPPubNubConfiguration(configuration: self.pubnub.configuration) super.init() } } @@ -104,6 +103,18 @@ public extension KMPPubNub { } } +// MARK: - LogLevel + +@objc public extension KMPPubNub { + var logLevel: KMPLogLevel { + get { + KMPLogLevel(rawValue: pubnub.logLevel.rawValue) + } set { + pubnub.logLevel = LogLevel(rawValue: newValue.rawValue) + } + } +} + // MARK: - Configuration @objc @@ -123,4 +134,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..e25a29f0 --- /dev/null +++ b/Sources/PubNub/KMP/Wrappers/KMPLogLevel.swift @@ -0,0 +1,26 @@ +// +// 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 { + @objc public private(set) var rawValue: UInt32 + + @objc public init(rawValue: UInt32) { + self.rawValue = rawValue + } +}