Skip to content

Commit

Permalink
Remove customParam adding.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsligh committed Aug 29, 2024
1 parent 7bba000 commit 5c3a9c1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
21 changes: 0 additions & 21 deletions PrebidMobile/ConfigurationAndTargeting/Targeting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -344,27 +344,6 @@ public class Targeting: NSObject {
}
}

public func setCustomParams(_ params: [String : String]?) {
guard let params = params else {
return
}

params.keys.forEach { key in
if let value = params[key] {
addCustomParam(value, withName: key)
}
}
}

public func addCustomParam(_ value: String, withName: String?) {
guard let name = withName else {
return
}

let prefixedName = makeCustomParamFromName(name)
addParam(value, withName:prefixedName)
}

// Store location in the user's section
public func setLatitude(_ latitude: Double, longitude: Double) {
coordinate = NSValue(mkCoordinate: CLLocationCoordinate2DMake(latitude, longitude))
Expand Down
29 changes: 0 additions & 29 deletions PrebidMobileTests/TargetingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -997,35 +997,6 @@ class TargetingTests: XCTestCase {
Targeting.addParam("", withName: "name")
XCTAssert(Targeting.parameterDictionary == [:], "Dict is \(Targeting.parameterDictionary)")
}

func testAddCustomParam() {

//Init
let Targeting = Targeting.shared
XCTAssert(Targeting.parameterDictionary == [:], "Dict is \(Targeting.parameterDictionary)")

//Set
Targeting.addCustomParam("value", withName: "name")
XCTAssert(Targeting.parameterDictionary == ["c.name":"value"], "Dict is \(Targeting.parameterDictionary)")

//Unset
Targeting.addCustomParam("", withName: "name")
XCTAssert(Targeting.parameterDictionary == [:], "Dict is \(Targeting.parameterDictionary)")
}

func testSetCustomParams() {
//Init
let Targeting = Targeting.shared
XCTAssert(Targeting.parameterDictionary == [:], "Dict is \(Targeting.parameterDictionary)")

//Set
Targeting.setCustomParams(["name1":"value1", "name2":"value2"])
XCTAssert(Targeting.parameterDictionary == ["c.name1":"value1", "c.name2":"value2"], "Dict is \(Targeting.parameterDictionary)")

//Not currently possible to unset
Targeting.setCustomParams([:])
XCTAssert(Targeting.parameterDictionary == ["c.name1":"value1", "c.name2":"value2"], "Dict is \(Targeting.parameterDictionary)")
}

func testKeywords() {
//Init
Expand Down

0 comments on commit 5c3a9c1

Please sign in to comment.