Skip to content

Commit

Permalink
Removed buyerUID
Browse files Browse the repository at this point in the history
  • Loading branch information
jsligh committed Sep 3, 2024
1 parent 9b55c54 commit cfa9de3
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ struct TestCaseManager {
targeting.userGender = TestCaseManager.strToGender(value)
}

if let value = openRtb["buyerid"] as? String {
targeting.buyerUID = value
}
if let value = openRtb["xid"] as? String {
targeting.userID = value
}
Expand Down
5 changes: 0 additions & 5 deletions PrebidMobile/ConfigurationAndTargeting/Targeting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ public class Targeting: NSObject {
set { parameterDictionary[PrebidTargetingKey_USER_ID] = newValue }
}

/**
Buyer-specific ID for the user as mapped by the exchange for the buyer.
*/
public var buyerUID: String?

/**
Optional feature to pass bidder data that was set in the
exchange’s cookie. The string must be in base85 cookie safe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ + (nonnull PBMORTBBidRequest *)createORTBBidRequestWithTargeting:(nonnull Target
}

bidRequest.user.gender = targeting.userGenderDescription;
bidRequest.user.buyeruid = targeting.buyerUID;
bidRequest.user.customdata = targeting.userCustomData;
bidRequest.user.userid = targeting.userID;

Expand Down
2 changes: 0 additions & 2 deletions PrebidMobile/PrebidMobileRendering/ORTB/PBMORTBUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ NS_ASSUME_NONNULL_BEGIN
//id not supported


//Buyer-specific ID for the user as mapped by the exchange for the buyer. At least one of buyerid or id is recommended.
@property (nonatomic, copy, nullable) NSString *buyeruid;

//Year of birth as a 4-digit integer
@property (nonatomic, strong, nullable) NSNumber *yob;
Expand Down
2 changes: 0 additions & 2 deletions PrebidMobile/PrebidMobileRendering/ORTB/PBMORTBUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ - (nonnull PBMJsonDictionary *)toJsonDictionary {

ret[@"yob"] = self.yob;
ret[@"gender"] = self.gender;
ret[@"buyeruid"] = self.buyeruid;
ret[@"keywords"] = self.keywords;
ret[@"customdata"] = self.customdata;
ret[@"id"] = self.userid;
Expand Down Expand Up @@ -69,7 +68,6 @@ - (instancetype)initWithJsonDictionary:(nonnull PBMJsonDictionary *)jsonDictiona
}
_yob = jsonDictionary[@"yob"];
_gender = jsonDictionary[@"gender"];
_buyeruid = jsonDictionary[@"buyeruid"];
_keywords = jsonDictionary[@"keywords"];
_customdata = jsonDictionary[@"customdata"];
_ext = jsonDictionary[@"ext"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class ParameterBuilderServiceTest : XCTestCase {
targeting.parameterDictionary["foo"] = "bar"
targeting.coppa = 1
targeting.userGender = .male
targeting.buyerUID = "buyerUID"
targeting.storeURL = url
targeting.userCustomData = "customDataString"
targeting.publisherName = publisherName
Expand Down Expand Up @@ -155,7 +154,7 @@ class ParameterBuilderServiceTest : XCTestCase {
}

let expectedOrtb = """
{\"app\":{\"bundle\":\"Mock.Bundle.Identifier\",\"keywords\":\"appKeyword1,appKeyword2\",\"name\":\"MockBundleDisplayName\",\"publisher\":{\"name\":\"Publisher\"},\"storeurl\":\"https:\\/\\/openx.com\"},\"device\":{\(carrier)\"connectiontype\":2,\(deviceExt)\"geo\":{\"lat\":34.149335,\"lon\":-118.1328249,\"type\":1},\"h\":200,\"hwv\":\"iPhone1,1\",\"ifa\":\"abc123\",\"language\":\"ml\",\"lmt\":0,\"make\":\"MockMake\",\(mccmnc)\"model\":\"MockModel\",\"os\":\"MockOS\",\"osv\":\"1.2.3\",\"w\":100},\"imp\":[{\"clickbrowser\":1,\"displaymanager\":\"prebid-mobile\",\"displaymanagerver\":\"MOCK_SDK_VERSION\",\"ext\":{\"dlp\":1},\"instl\":0,\"secure\":1}],\"regs\":{\"coppa\":1,\"ext\":{\"gdpr\":0}},\"user\":{\"buyeruid\":\"buyerUID\",\"customdata\":\"customDataString\",\"ext\":{\"consent\":\"consentstring\"},\"gender\":\"M\",\"id\":\"userID\",\"keywords\":\"keyword1,keyword2\"}}
{\"app\":{\"bundle\":\"Mock.Bundle.Identifier\",\"keywords\":\"appKeyword1,appKeyword2\",\"name\":\"MockBundleDisplayName\",\"publisher\":{\"name\":\"Publisher\"},\"storeurl\":\"https:\\/\\/openx.com\"},\"device\":{\(carrier)\"connectiontype\":2,\(deviceExt)\"geo\":{\"lat\":34.149335,\"lon\":-118.1328249,\"type\":1},\"h\":200,\"hwv\":\"iPhone1,1\",\"ifa\":\"abc123\",\"language\":\"ml\",\"lmt\":0,\"make\":\"MockMake\",\(mccmnc)\"model\":\"MockModel\",\"os\":\"MockOS\",\"osv\":\"1.2.3\",\"w\":100},\"imp\":[{\"clickbrowser\":1,\"displaymanager\":\"prebid-mobile\",\"displaymanagerver\":\"MOCK_SDK_VERSION\",\"ext\":{\"dlp\":1},\"instl\":0,\"secure\":1}],\"regs\":{\"coppa\":1,\"ext\":{\"gdpr\":0}},\"user\":{\"customdata\":\"customDataString\",\"ext\":{\"consent\":\"consentstring\"},\"gender\":\"M\",\"id\":\"userID\",\"keywords\":\"keyword1,keyword2\"}}
"""
PBMAssertEq(strORTB, expectedOrtb)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ typealias JsonDictionary = [String:Any]

targeting.userGender = .unknown
targeting.userID = nil
targeting.buyerUID = nil
targeting.publisherName = nil
targeting.storeURL = nil
targeting.userCustomData = nil
Expand Down Expand Up @@ -324,7 +323,6 @@ typealias JsonDictionary = [String:Any]
@objc public class func checkInitialValues(_ targeting: Targeting) {
XCTAssertEqual(targeting.userGender, .unknown)
XCTAssertNil(targeting.userID)
XCTAssertNil(targeting.buyerUID)
XCTAssertNil(targeting.publisherName)
XCTAssertNil(targeting.storeURL)
XCTAssertNil(targeting.userCustomData)
Expand Down
18 changes: 0 additions & 18 deletions PrebidMobileTests/TargetingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -870,24 +870,6 @@ class TargetingTests: XCTestCase {
XCTAssert(Targeting.parameterDictionary == [:], "Dict is \(Targeting.parameterDictionary)")
}

func testBuyerUID() {
//Init
//Note: on init, and it never sends a value via an odinary ad request params.
let Targeting = Targeting.shared
XCTAssertNil(Targeting.buyerUID)
XCTAssert(Targeting.parameterDictionary == [:], "Dict is \(Targeting.parameterDictionary)")

//Set
let buyerUID = "abc123"
Targeting.buyerUID = buyerUID
XCTAssertEqual(Targeting.buyerUID, buyerUID)
XCTAssert(Targeting.parameterDictionary == [:], "Dict is \(Targeting.parameterDictionary)")

//Unset
Targeting.buyerUID = nil
XCTAssert(Targeting.parameterDictionary == [:], "Dict is \(Targeting.parameterDictionary)")
}

func testUserCustomData() {

//Init
Expand Down

0 comments on commit cfa9de3

Please sign in to comment.