Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed LocationPrecision #1049

Open
wants to merge 1 commit into
base: 3.0.0-official-branch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions PrebidMobile/ConfigurationAndTargeting/Targeting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -307,19 +307,6 @@ public class Targeting: NSObject {
*/
public var location: CLLocation?

/**
* The application location precision for targeting
*/
public var locationPrecision: Int?

public func setLocationPrecision(_ newValue: NSNumber?) {
locationPrecision = newValue?.intValue
}

public func getLocationPrecision() -> NSNumber? {
return locationPrecision as NSNumber?
}

// MARK: - Location and connection information

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ typealias JsonDictionary = [String:Any]
targeting.userExt = nil
targeting.eids = nil
targeting.location = nil
targeting.locationPrecision = nil
targeting.sourceapp = nil
targeting.storeURL = nil
targeting.domain = nil
Expand Down Expand Up @@ -331,7 +330,6 @@ typealias JsonDictionary = [String:Any]
XCTAssertNil(targeting.userExt)
XCTAssertNil(targeting.eids)
XCTAssertNil(targeting.location)
XCTAssertNil(targeting.locationPrecision)
XCTAssertNil(targeting.sourceapp)
XCTAssertNil(targeting.storeURL)
XCTAssertNil(targeting.domain)
Expand Down
28 changes: 0 additions & 28 deletions PrebidMobileTests/TargetingObjCTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,34 +123,6 @@ - (void)testLocation {

}

- (void)testLocationPrecision {
//given
NSNumber *locationPrecision1 = @1;
int locationPrecision2 = 2;
NSNumber *locationPrecision3 = @3;
NSNumber *locationPrecision4 = nil;

//when
[Targeting.shared setLocationPrecision: locationPrecision1];
NSNumber *result1 = [Targeting.shared getLocationPrecision];

[Targeting.shared setLocationPrecision: [NSNumber numberWithInt:locationPrecision2]];
int result2 = [[Targeting.shared getLocationPrecision] intValue];

[Targeting.shared setLocationPrecision: locationPrecision3];
int result3 = [[Targeting.shared getLocationPrecision] intValue];

[Targeting.shared setLocationPrecision: locationPrecision4];
NSNumber *result4 = [Targeting.shared getLocationPrecision];

//then
XCTAssertEqualObjects(locationPrecision1, result1);
XCTAssertEqual(locationPrecision2, result2);
XCTAssertEqual(3, result3);
XCTAssertNil(result4);

}

// MARK: - Year Of Birth
- (void)testYearOfBirth {
//given
Expand Down
13 changes: 0 additions & 13 deletions PrebidMobileTests/TargetingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,9 @@ class TargetingTests: XCTestCase {

//when
Targeting.shared.location = location
Targeting.shared.locationPrecision = 2

//then
XCTAssertEqual(location, Targeting.shared.location)
XCTAssertEqual(2, Targeting.shared.locationPrecision)
}

func testLocationPrecision() {
//given
let locationPrecision = 2

//when
Targeting.shared.locationPrecision = locationPrecision

//then
XCTAssertEqual(locationPrecision, Targeting.shared.locationPrecision)
}

// MARK: - Year Of Birth
Expand Down