Skip to content

Commit

Permalink
Corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinPostindustria committed Apr 11, 2023
1 parent a99c43c commit 52e89e4
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions prebid-mobile/pbm-api/ios/ios-sdk-integration-gam-original-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,30 +427,27 @@ Integration Example:

```swift
// 1. Create a InterstitialAdUnit
adUnit = InterstitialAdUnit(configId: storedImpVideoInterstitial)
adUnit = InterstitialAdUnit(configId: CONFIG_ID, adFormats: [.video])

// 2. Set ad format
adUnit.adFormats = [.video]

// 3. Configure video parameters
// 2. Configure video parameters
let parameters = VideoParameters(mimes: ["video/mp4"])
parameters.protocols = [Signals.Protocols.VAST_2_0]
parameters.playbackMethod = [Signals.PlaybackMethod.AutoPlaySoundOff]
adUnit.videoParameters = parameters

// 4. Make a bid request to Prebid Server
// 3. Make a bid request to Prebid Server
let gamRequest = GAMRequest()
adUnit.fetchDemand(adObject: gamRequest) { [weak self] resultCode in
PrebidDemoLogger.shared.info("Prebid demand fetch for GAM \(resultCode.name())")

// 5. Load a GAM interstitial ad
// 4. Load a GAM interstitial ad
GAMInterstitialAd.load(withAdManagerAdUnitID: gamAdUnitVideoInterstitialOriginal, request: gamRequest) { ad, error in
guard let self = self else { return }
if let error = error {
PrebidDemoLogger.shared.error("Failed to load interstitial ad with error: \(error.localizedDescription)")
} else if let ad = ad {

// 6. Present the interstitial ad
// 5. Present the interstitial ad
ad.present(fromRootViewController: self)
ad.fullScreenContentDelegate = self
}
Expand Down Expand Up @@ -496,23 +493,20 @@ Integration example:

``` swift
// 1. Create an InterstitialAdUnit
adUnit = InterstitialAdUnit(configId: storedImpsInterstitial.randomElement()!, minWidthPerc: 60, minHeightPerc: 70)

// 2. Set adFormats
adUnit.adFormats = [.display, .video]
adUnit = InterstitialAdUnit(configId: CONFIG_ID, adFormats: [.display, .video], minWidthPerc: 60, minHeightPerc: 70)

// 3. Configure parameters
// 2. Configure parameters
let parameters = VideoParameters(mimes: ["video/mp4"])
parameters.protocols = [Signals.Protocols.VAST_2_0]
parameters.playbackMethod = [Signals.PlaybackMethod.AutoPlaySoundOff]
adUnit.videoParameters = parameters

// 4. Make a bid request to Prebid Server
// 3. Make a bid request to Prebid Server
let gamRequest = GAMRequest()
adUnit.fetchDemand(adObject: gamRequest) { [weak self] resultCode in
PrebidDemoLogger.shared.info("Prebid demand fetch for GAM \(resultCode.name())")

// 5. Load a GAM interstitial ad
// 4. Load a GAM interstitial ad
GAMInterstitialAd.load(withAdManagerAdUnitID: gamAdUnitMultiformatInterstitialOriginal, request: gamRequest) { ad, error in
guard let self = self else { return }

Expand Down

0 comments on commit 52e89e4

Please sign in to comment.