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

Deprecate methods and properties for 3.0 #1109

Open
wants to merge 3 commits into
base: master
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
10 changes: 10 additions & 0 deletions PrebidMobile/AdUnits/AdUnit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -385,37 +385,43 @@ public class AdUnit: NSObject, DispatcherDelegate {
/// Sets the app content object, replacing any existing content.
///
/// - Parameter appContentObject: The `PBMORTBAppContent` object representing the app's content.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func setAppContent(_ appContentObject: PBMORTBAppContent) {
adUnitConfig.setAppContent(appContentObject)
}

/// Retrieves the current app content object.
///
/// - Returns: The current `PBMORTBAppContent` object, or `nil` if no content is set.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.getGlobalORTBConfig method instead.")
public func getAppContent() -> PBMORTBAppContent? {
return adUnitConfig.getAppContent()
}

/// Clears the current app content object.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearAppContent() {
adUnitConfig.clearAppContent()
}

/// Adds an array of content data objects to the app content.
///
/// - Parameter dataObjects: An array of `PBMORTBContentData` objects to add.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func addAppContentData(_ dataObjects: [PBMORTBContentData]) {
adUnitConfig.addAppContentData(dataObjects)
}

/// Removes a specific content data object from the app content.
///
/// - Parameter dataObject: The `PBMORTBContentData` object to remove.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func removeAppContentData(_ dataObject: PBMORTBContentData) {
adUnitConfig.removeAppContentData(dataObject)
}

/// Clears all content data objects from the app content.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearAppContentData() {
adUnitConfig.clearAppContentData()
}
Expand All @@ -425,25 +431,29 @@ public class AdUnit: NSObject, DispatcherDelegate {
/// Retrieves the current user data.
///
/// - Returns: An array of `PBMORTBContentData` objects representing the user data, or `nil` if no data is available.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.getGlobalORTBConfig method instead.")
public func getUserData() -> [PBMORTBContentData]? {
return adUnitConfig.getUserData()
}

/// Adds an array of user data objects.
///
/// - Parameter userDataObjects: An array of `PBMORTBContentData` objects to add to the user data.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func addUserData(_ userDataObjects: [PBMORTBContentData]) {
adUnitConfig.addUserData(userDataObjects)
}

/// Removes a specific user data object.
///
/// - Parameter userDataObject: The `PBMORTBContentData` object to remove from the user data.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func removeUserData(_ userDataObject: PBMORTBContentData) {
adUnitConfig.removeUserData(userDataObject)
}

/// Clears all user data.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearUserData() {
adUnitConfig.clearUserData()
}
Expand Down
1 change: 1 addition & 0 deletions PrebidMobile/ConfigurationAndTargeting/Prebid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public class Prebid: NSObject {
// MARK: - Public Properties (Prebid)

/// The host for the Prebid Server.
@available(*, deprecated, message: "This property is deprecated. In the upcoming major release, the property will be removed.")
public var prebidServerHost: PrebidHost = .Custom {
didSet {
timeoutMillisDynamic = NSNumber(value: timeoutMillis)
Expand Down
6 changes: 6 additions & 0 deletions PrebidMobile/ConfigurationAndTargeting/Targeting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ public class Targeting: NSObject {
/// - Parameters:
/// - key: The key for the user data.
/// - value: The value to add for the specified key.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed.")
public func addUserData(key: String, value: String) {
var values = rawUserDataDictionary[key] ?? Set<String>()
values.insert(value)
Expand All @@ -479,32 +480,37 @@ public class Targeting: NSObject {
/// - Parameters:
/// - key: The key for the user data.
/// - value: The set of values to update for the specified key.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed.")
public func updateUserData(key: String, value: Set<String>) {
rawUserDataDictionary[key] = value
}

/// Removes user data for a specified key.
///
/// - Parameter key: The key for the user data to remove.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed.")
public func removeUserData(for key: String) {
rawUserDataDictionary.removeValue(forKey: key)
}

/// Clears all user data.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed.")
public func clearUserData() {
rawUserDataDictionary.removeAll()
}

/// Retrieves all user data.
///
/// - Returns: A dictionary mapping keys to arrays of values.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed.")
public func getUserData() -> [String: [String]] {
rawUserDataDictionary.mapValues { Array($0) }
}

/// User data dictionary for external use.
///
/// - Returns: A dictionary mapping keys to arrays of values.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed.")
public var userDataDictionary: [String : [String]] {
rawUserDataDictionary.mapValues { Array($0) }
}
Expand Down
1 change: 1 addition & 0 deletions PrebidMobile/Host.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import UIKit

/// `PrebidHost` represents various Prebid server hosts used for ad bidding.
@available(*, deprecated, message: "This enum is deprecated. In the upcoming major release, the enum will be removed.")
@objc public enum PrebidHost: Int {

/// URL [https://ib.adnxs.com/openrtb2/prebid](URL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,28 +391,33 @@ public class BannerView:

/// Sets the app content data.
/// - Parameter appContent: The app content data.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func setAppContent(_ appContent: PBMORTBAppContent) {
adUnitConfig.setAppContent(appContent)
}

/// Clears the app content data.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearAppContent() {
adUnitConfig.clearAppContent()
}

/// Adds app content data objects.
/// - Parameter dataObjects: The data objects to be added.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func addAppContentData(_ dataObjects: [PBMORTBContentData]) {
adUnitConfig.addAppContentData(dataObjects)
}

/// Removes an app content data object.
/// - Parameter dataObject: The data object to be removed.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func removeAppContentDataObject(_ dataObject: PBMORTBContentData) {
adUnitConfig.removeAppContentData(dataObject)
}

/// Clears all app content data objects.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearAppContentDataObjects() {
adUnitConfig.clearAppContentData()
}
Expand All @@ -421,17 +426,20 @@ public class BannerView:

/// Adds user data objects.
/// - Parameter userDataObjects: The user data objects to be added.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func addUserData(_ userDataObjects: [PBMORTBContentData]) {
adUnitConfig.addUserData(userDataObjects)
}

/// Removes a user data object.
/// - Parameter userDataObject: The user data object to be removed.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func removeUserData(_ userDataObject: PBMORTBContentData) {
adUnitConfig.removeUserData(userDataObject)
}

/// Clears all user data objects.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearUserData() {
adUnitConfig.clearUserData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,28 +325,33 @@ public class InterstitialRenderingAdUnit: NSObject, BaseInterstitialAdUnitProtoc

/// Sets the app content data.
/// - Parameter appContent: The app content data.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func setAppContent(_ appContent: PBMORTBAppContent) {
adUnitConfig.setAppContent(appContent)
}

/// Clears the app content data.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearAppContent() {
adUnitConfig.clearAppContent()
}

/// Adds app content data objects.
/// - Parameter dataObjects: The data objects to be added.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func addAppContentData(_ dataObjects: [PBMORTBContentData]) {
adUnitConfig.addAppContentData(dataObjects)
}

/// Removes an app content data object.
/// - Parameter dataObject: The data object to be removed.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func removeAppContentDataObject(_ dataObject: PBMORTBContentData) {
adUnitConfig.removeAppContentData(dataObject)
}

/// Clears all app content data objects.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearAppContentDataObjects() {
adUnitConfig.clearAppContentData()
}
Expand All @@ -355,17 +360,20 @@ public class InterstitialRenderingAdUnit: NSObject, BaseInterstitialAdUnitProtoc

/// Adds user data objects.
/// - Parameter userDataObjects: The user data objects to be added.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func addUserData(_ userDataObjects: [PBMORTBContentData]) {
adUnitConfig.addUserData(userDataObjects)
}

/// Removes a user data object.
/// - Parameter userDataObject: The user data object to be removed.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func removeUserData(_ userDataObject: PBMORTBContentData) {
adUnitConfig.removeUserData(userDataObject)
}

/// Clears all user data objects.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearUserData() {
adUnitConfig.clearUserData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,28 +309,33 @@ public class RewardedAdUnit: NSObject, BaseInterstitialAdUnitProtocol {

/// Sets the app content data.
/// - Parameter appContent: The app content data.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func setAppContent(_ appContent: PBMORTBAppContent) {
adUnitConfig.setAppContent(appContent)
}

/// Clears the app content data.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearAppContent() {
adUnitConfig.clearAppContent()
}

/// Adds app content data objects.
/// - Parameter dataObjects: The data objects to be added.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func addAppContentData(_ dataObjects: [PBMORTBContentData]) {
adUnitConfig.addAppContentData(dataObjects)
}

/// Removes an app content data object.
/// - Parameter dataObject: The data object to be removed.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func removeAppContentDataObject(_ dataObject: PBMORTBContentData) {
adUnitConfig.removeAppContentData(dataObject)
}

/// Clears all app content data objects.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearAppContentDataObjects() {
adUnitConfig.clearAppContentData()
}
Expand All @@ -339,17 +344,20 @@ public class RewardedAdUnit: NSObject, BaseInterstitialAdUnitProtocol {

/// Adds user data objects.
/// - Parameter userDataObjects: The user data objects to be added.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func addUserData(_ userDataObjects: [PBMORTBContentData]) {
adUnitConfig.addUserData(userDataObjects)
}

/// Removes a user data object.
/// - Parameter userDataObject: The user data object to be removed.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func removeUserData(_ userDataObject: PBMORTBContentData) {
adUnitConfig.removeUserData(userDataObject)
}

/// Clears all user data objects.
@available(*, deprecated, message: "This method is deprecated. In the upcoming major release, the method will be removed. Please, use Targeting.setGlobalORTBConfig method instead.")
public func clearUserData() {
adUnitConfig.clearUserData()
}
Expand Down
Loading