MPSPage
public final class MPSPage: NSObject
Facilitates ad requests and other functionality for a particular content page.
-
Constructor. Creates the instance of page.
Declaration
Swift
required public init(mpsService: MPS, parameters: MPSPageParameters, enableTestMode: Bool)
Parameters
mpsService
MPS - MPS instance.
parameters
MPSPageParameters - parameters of the page.
-
Get the URL of the MPS page request.
Declaration
Swift
public private(set) var mpsURL: URL?
-
Gets banner ad for the specified ad slot.
Declaration
Swift
public func getBannerAd(adSlot: String, additionalTargeting: [AnyHashable: Any], rootViewController: UIViewController, success: @escaping GetGoogleBannerAdBlock, failure: @escaping (_ error: Error) -> Void )
Parameters
adSlot
String - ad slot name for the requested ad.
additionalTargeting
Additional key/value pairs to add to the targeting fields in Ad request to Google
rootViewController
UIViewController - root view controller, required for ad view object.
success
Success block that contains ad view.
failure
Failure block to handle ad request errors.
-
Gets banner ad for the specified ad slot.
Declaration
Swift
public func getBannerAd(adSlot: String, rootViewController: UIViewController, success: @escaping GetGoogleBannerAdBlock, failure: @escaping (_ error: Error) -> Void )
Parameters
adSlot
String - ad slot name for the requested ad.
rootViewController
UIViewController - root view controller, required for ad view object.
success
Success block that contains ad view.
failure
Failure block to handle ad request errors.
-
Gets interstitial ad for the specified ad slot.
Declaration
Swift
public func getInterstitialAd(adSlot: String, success: @escaping GetGoogleInterstitialAdBlock, failure: @escaping (_ error: Error) -> Void )
Parameters
adSlot
String - ad slot name for the requested ad.
success
Success block that contains ad view.
failure
Failure block to handle ad request errors.
-
Gets interstitial ad for the specified ad slot.
Declaration
Swift
public func getInterstitialAd(adSlot: String, additionalTargeting: [AnyHashable: Any], success: @escaping GetGoogleInterstitialAdBlock, failure: @escaping (_ error: Error) -> Void )
Parameters
adSlot
String - ad slot name for the requested ad.
additionalTargeting
Additional key/value pairs to add to the targeting fields in Ad request to Google
success
Success block that contains ad view.
failure
Failure block to handle ad request errors.
-
Gets MPS JSON for a MPSPage.
Declaration
Swift
public func getMPSPageJSON(success: @escaping ((_ json: [String: Any], _ data: Data) -> Void), failure: @escaping ((_ error: Error) -> Void))
Parameters
success
Success block that contains MPS Page JSON.
failure
Failure block to handle json response errors.
-
Resets correlator of page object.
Declaration
Swift
public func resetCorrelator()