From ae2ae729b58e8973862ed31a87020959bed4bb19 Mon Sep 17 00:00:00 2001 From: Sunny Wu Date: Wed, 13 May 2026 12:32:40 +1000 Subject: [PATCH] UID2-7075 Fix UID2Prebid compile error with PrebidMobile 3.3.1+ PrebidMobile 3.3.1 (prebid/prebid-mobile-ios#1257) renamed the `UserUniqueID` initializer parameter from `id:` to `uniqueId:` to fix an Objective-C interoperability conflict, and renamed the Swift property accordingly. Update our call sites in UID2Prebid and the tests to match, and raise the PrebidMobile minimum (SPM and CocoaPods) to 3.3.1 so consumers can't resolve a version where the parameter name doesn't match the call site. Fixes IABTechLab/uid2-ios-sdk#87 Co-Authored-By: Claude Opus 4.7 (1M context) --- Package.resolved | 8 ++++---- Package.swift | 2 +- Sources/UID2Prebid/UID2Prebid.swift | 2 +- Tests/UID2PrebidTests/UID2PrebidTests.swift | 18 +++++++++--------- UID2Prebid.podspec.json | 3 ++- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Package.resolved b/Package.resolved index e14c6c7..eef2273 100644 --- a/Package.resolved +++ b/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/prebid/prebid-mobile-ios.git", "state" : { - "revision" : "e632be68c5f74261fa550374b41699b481824dd3", - "version" : "3.1.0" + "revision" : "4f96890f9f8b38db6abd92044a928a709d5458d2", + "version" : "3.3.1" } }, { @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/googleads/swift-package-manager-google-mobile-ads.git", "state" : { - "revision" : "d24a9f5ad472610598449dc669befa5b7ed50658", - "version" : "12.7.0" + "revision" : "e2b1c31cdf11cb4b57b4e70ae4c313d4e48c444a", + "version" : "13.3.0" } }, { diff --git a/Package.swift b/Package.swift index 35d61b9..a17d398 100644 --- a/Package.swift +++ b/Package.swift @@ -20,7 +20,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/apple/swift-asn1.git", .upToNextMajor(from: "1.0.0")), - .package(url: "https://github.com/prebid/prebid-mobile-ios.git", .upToNextMajor(from: "3.1.0")), + .package(url: "https://github.com/prebid/prebid-mobile-ios.git", .upToNextMajor(from: "3.3.1")), ], targets: [ .target( diff --git a/Sources/UID2Prebid/UID2Prebid.swift b/Sources/UID2Prebid/UID2Prebid.swift index 773653b..32b6394 100644 --- a/Sources/UID2Prebid/UID2Prebid.swift +++ b/Sources/UID2Prebid/UID2Prebid.swift @@ -80,7 +80,7 @@ public actor UID2Prebid { if let advertisingToken { userIDs.append(ExternalUserId( source: source, - uids: [.init(id: advertisingToken, aType: agentType)] + uids: [.init(uniqueId: advertisingToken, aType: agentType)] )) } await userIDUpdater.updateUserIDs(userIDs) diff --git a/Tests/UID2PrebidTests/UID2PrebidTests.swift b/Tests/UID2PrebidTests/UID2PrebidTests.swift index 8985a92..18caf4b 100644 --- a/Tests/UID2PrebidTests/UID2PrebidTests.swift +++ b/Tests/UID2PrebidTests/UID2PrebidTests.swift @@ -52,7 +52,7 @@ final class UID2PrebidTests: XCTestCase { ) await observation( of: [ - ExternalUserId(source: "uidapi.com", uids: [.init(id: "cat", aType: 3)]) + ExternalUserId(source: "uidapi.com", uids: [.init(uniqueId: "cat", aType: 3)]) ], by: updater ) @@ -68,7 +68,7 @@ final class UID2PrebidTests: XCTestCase { ) await observation( of: [ - ExternalUserId(source: "uidapi.com", uids: [.init(id: "turtle", aType: 3)]) + ExternalUserId(source: "uidapi.com", uids: [.init(uniqueId: "turtle", aType: 3)]) ], by: updater ) @@ -93,7 +93,7 @@ final class UID2PrebidTests: XCTestCase { manager: manager, thirdPartyUserIDs: { [ - ExternalUserId(source: "example.com", uids: [.init(id: "dog", aType: 3)]) + ExternalUserId(source: "example.com", uids: [.init(uniqueId: "dog", aType: 3)]) ] }, userIDUpdater: updater, @@ -106,8 +106,8 @@ final class UID2PrebidTests: XCTestCase { ) await observation( of: [ - ExternalUserId(source: "example.com", uids: [.init(id: "dog", aType: 3)]), - ExternalUserId(source: "uidapi.com", uids: [.init(id: "cat", aType: 3)]), + ExternalUserId(source: "example.com", uids: [.init(uniqueId: "dog", aType: 3)]), + ExternalUserId(source: "uidapi.com", uids: [.init(uniqueId: "cat", aType: 3)]), ], by: updater ) @@ -115,7 +115,7 @@ final class UID2PrebidTests: XCTestCase { continuation.yield(.invalid) await observation( of: [ - ExternalUserId(source: "example.com", uids: [.init(id: "dog", aType: 3)]), + ExternalUserId(source: "example.com", uids: [.init(uniqueId: "dog", aType: 3)]), ], by: updater ) @@ -148,7 +148,7 @@ final class UID2PrebidTests: XCTestCase { ) await observation( of: [ - ExternalUserId(source: "euid.eu", uids: [.init(id: "cat", aType: 3)]) + ExternalUserId(source: "euid.eu", uids: [.init(uniqueId: "cat", aType: 3)]) ], by: updater ) @@ -164,7 +164,7 @@ final class UID2PrebidTests: XCTestCase { ) await observation( of: [ - ExternalUserId(source: "euid.eu", uids: [.init(id: "turtle", aType: 3)]) + ExternalUserId(source: "euid.eu", uids: [.init(uniqueId: "turtle", aType: 3)]) ], by: updater ) @@ -205,7 +205,7 @@ extension UID2PrebidTests { var id: String var aType: Int init(_ userId: UserUniqueID) { - self.id = userId.id + self.id = userId.uniqueId self.aType = userId.aType.intValue } } diff --git a/UID2Prebid.podspec.json b/UID2Prebid.podspec.json index b42e4b3..89f4d06 100644 --- a/UID2Prebid.podspec.json +++ b/UID2Prebid.podspec.json @@ -32,7 +32,8 @@ "~> 1.3.0" ], "PrebidMobile": [ - "~> 3.1" + ">= 3.3.1", + "< 4.0" ] } }