From 636d643bf92dd392fdd01e15ccb54bb9888371d4 Mon Sep 17 00:00:00 2001 From: Jono Sligh Date: Thu, 5 Sep 2024 07:40:27 -0500 Subject: [PATCH] Deprecated year of birth, age, and gender functions. --- PrebidMobile/ConfigurationAndTargeting/AgeUtils.swift | 3 ++- PrebidMobile/ConfigurationAndTargeting/Gender.swift | 2 ++ PrebidMobile/ConfigurationAndTargeting/Targeting.swift | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/PrebidMobile/ConfigurationAndTargeting/AgeUtils.swift b/PrebidMobile/ConfigurationAndTargeting/AgeUtils.swift index 091a260f9..ace561f9f 100644 --- a/PrebidMobile/ConfigurationAndTargeting/AgeUtils.swift +++ b/PrebidMobile/ConfigurationAndTargeting/AgeUtils.swift @@ -18,7 +18,8 @@ import Foundation @objc(PBMAgeUtils) @objcMembers public class AgeUtils: NSObject { - static func isYOBValid(_ yob: Int) -> Bool { + @available(*, deprecated, message: "Deprecated by ORTB") + static func isYOBValid(_ yob: Int) -> Bool { let date = Date() let calendar = Calendar.current diff --git a/PrebidMobile/ConfigurationAndTargeting/Gender.swift b/PrebidMobile/ConfigurationAndTargeting/Gender.swift index 556c57f23..25bff5277 100644 --- a/PrebidMobile/ConfigurationAndTargeting/Gender.swift +++ b/PrebidMobile/ConfigurationAndTargeting/Gender.swift @@ -29,6 +29,7 @@ enum GenderDescription : String { case other = "O" } +@available(*, deprecated, message: "Deprecated by ORTB") func GenderFromDescription(_ genderDescription: String) -> Gender { guard let knownGender = GenderDescription(rawValue: genderDescription) else { return .unknown @@ -41,6 +42,7 @@ func GenderFromDescription(_ genderDescription: String) -> Gender { } } +@available(*, deprecated, message: "Deprecated by ORTB") func DescriptionOfGender(_ gender: Gender) -> String? { switch gender { case .unknown: return nil diff --git a/PrebidMobile/ConfigurationAndTargeting/Targeting.swift b/PrebidMobile/ConfigurationAndTargeting/Targeting.swift index 8d46e5333..cdad00ac7 100644 --- a/PrebidMobile/ConfigurationAndTargeting/Targeting.swift +++ b/PrebidMobile/ConfigurationAndTargeting/Targeting.swift @@ -38,6 +38,7 @@ public class Targeting: NSObject { /** Indicates user birth year. */ + @available(*, deprecated, message: "Deprecated by ORTB") public var yearOfBirth: Int { get { yearofbirth } set { setYearOfBirth(yob: newValue) } @@ -46,6 +47,7 @@ public class Targeting: NSObject { /** * This method set the year of birth value */ + @available(*, deprecated, message: "Deprecated by ORTB") public func setYearOfBirth(yob: Int) { if AgeUtils.isYOBValid(yob) { yearofbirth = yob @@ -55,6 +57,7 @@ public class Targeting: NSObject { } // Objective C API + @available(*, deprecated, message: "Deprecated by ORTB") public func getYearOfBirth() -> NSNumber { NSNumber(value: yearOfBirth) } @@ -69,6 +72,7 @@ public class Targeting: NSObject { /** Indicates the end-user's gender. */ + @available(*, deprecated, message: "Deprecated by ORTB") public var userGender: Gender { get { guard let currentValue = parameterDictionary[PrebidTargetingKey_GENDER] else {