Skip to content

Commit 04e1252

Browse files
committed
Upgrade PrebidMobile to 2.4.0
1 parent e9fb84a commit 04e1252

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

UID2Prebid.podspec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"~> 1.3.0"
3333
],
3434
"PrebidMobile": [
35-
"~> 2.0"
35+
"~> 2.4"
3636
]
3737
}
3838
}

UID2Prebid/Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "prebid/prebid-mobile-ios" "2.2.3"
1+
github "prebid/prebid-mobile-ios" "2.4.0"
Submodule prebid-mobile-ios updated 369 files

UID2Prebid/UID2Prebid/UID2Prebid.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ protocol UserIDUpdater: Sendable {
1010
struct PrebidUserIDUpdater: UserIDUpdater {
1111
/// Passes the observed IDs to Prebid
1212
func updateUserIDs(_ userIDs: [ExternalUserId]) {
13-
Prebid.shared.externalUserIdArray = userIDs
13+
Targeting.shared.setExternalUserIds(userIDs)
1414
}
1515
}
1616

1717
public actor UID2Prebid: Sendable {
1818
let thirdPartyUserIDs: @Sendable () async -> [ExternalUserId]
1919
let userIDUpdater: UserIDUpdater
20+
21+
// https://github.com/InteractiveAdvertisingBureau/AdCOM/blob/main/AdCOM%20v1.0%20FINAL.md#list_agenttypes
22+
// "An ID which is tied to a specific web browser or device (cookie-based, probabilistic, or other)."
23+
private let agentType: NSNumber = 1
2024
private let source = "uidapi.com"
2125
private var task: Task<Void, Never>?
2226

@@ -72,8 +76,10 @@ public actor UID2Prebid: Sendable {
7276
func updateExternalUserID(_ advertisingToken: String?) async {
7377
var userIDs = await self.thirdPartyUserIDs()
7478
if let advertisingToken {
75-
let advertisingTokenUser = ExternalUserId(source: source, identifier: advertisingToken)
76-
userIDs.append(advertisingTokenUser)
79+
userIDs.append(ExternalUserId(
80+
source: source,
81+
uids: [.init(id: advertisingToken, aType: agentType)]
82+
))
7783
}
7884
await userIDUpdater.updateUserIDs(userIDs)
7985
}

0 commit comments

Comments
 (0)