@@ -10,13 +10,17 @@ protocol UserIDUpdater: Sendable {
1010struct 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
1717public 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