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

Support SKAdN in Bidding Only scenario #1086

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8b34878
feat: support SKAdN in native
OlenaPostindustria Jan 14, 2025
0bd99b9
feat: proccess url in hidden manager if SKAdN is present
OlenaPostindustria Jan 14, 2025
2c274dd
feat: update gitignore
OlenaPostindustria Jan 14, 2025
f7b737b
feat: dismiss SKStoreProductViewController when finished
OlenaPostindustria Jan 15, 2025
88b8f3a
feat: implement SKAdN helper for ads that contain hb_ keys
OlenaPostindustria Jan 16, 2025
36f98a7
feat: update tests
OlenaPostindustria Jan 16, 2025
d82646e
feat: add examples to InternalTestApp
OlenaPostindustria Jan 16, 2025
27edf9c
feat: clean up
OlenaPostindustria Jan 16, 2025
1b30143
feat: clean up & change intervals
OlenaPostindustria Jan 17, 2025
52aeb1b
feat: inscrease interval
OlenaPostindustria Jan 17, 2025
1d4657e
feat: add support for video format
OlenaPostindustria Jan 20, 2025
3f4b325
feat: small enhancement
OlenaPostindustria Jan 21, 2025
6d56a3c
feat: introduce SKStoreProductViewControllerPresenter
OlenaPostindustria Feb 18, 2025
57de1cc
feat: add support of SKAdN view-through ads
OlenaPostindustria Feb 18, 2025
8daf53e
feat: introduce public api to activate SKAdN Store-Kit
OlenaPostindustria Feb 18, 2025
b2bb47f
feat: remove duplicated file
OlenaPostindustria Feb 18, 2025
d72329e
feat: remove duplicated file
OlenaPostindustria Feb 18, 2025
c97b37c
feat: add display delay
OlenaPostindustria Feb 21, 2025
2b5ac80
Revert "feat: add display delay"
OlenaPostindustria Feb 26, 2025
75d5e6f
feat: minor changes
OlenaPostindustria Feb 26, 2025
e68ac16
feat: remove support of SKAdN StoreKit for video ads
OlenaPostindustria Feb 26, 2025
3b722d5
fix: error after rebase
OlenaPostindustria Mar 11, 2025
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,7 @@ xcuserdata/
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
Pods/
Pods/

# Visual Studio Code
.build/
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,15 @@ struct TestCaseManager {
let bannerController = PrebidOriginalAPIDisplayBannerController(rootController: adapterVC)
bannerController.adSize = CGSize(width: 320, height: 50)

bannerController.prebidConfigId = "prebid-ita-banner-320-50";
bannerController.prebidConfigId = "prebid-ita-banner-320-50"
bannerController.adUnitID = "/21808260008/prebid_demo_app_original_api_banner"

adapterVC.setup(adapter: bannerController)

setupCustomParams(for: bannerController.prebidConfigId)
}),

TestCase(title: "Banner 320x50 (GAM Original) [NO SKAdN]",
TestCase(title: "Banner 320x50 SKAdN (GAM Original) [OK, PUC]",
tags: [.banner, .originalAPI, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in
Expand All @@ -281,9 +281,10 @@ struct TestCaseManager {
Targeting.shared.sourceapp = "InternalTestApp"

let bannerController = PrebidOriginalAPIDisplayBannerController(rootController: adapterVC)
bannerController.activatePrebidSKAdN = true
bannerController.adSize = CGSize(width: 320, height: 50)

bannerController.prebidConfigId = "prebid-ita-banner-320-50";
bannerController.prebidConfigId = "prebid-demo-banner-320-50-skadn"
bannerController.adUnitID = "/21808260008/prebid_demo_app_original_api_banner"

adapterVC.setup(adapter: bannerController)
Expand Down Expand Up @@ -352,7 +353,7 @@ struct TestCaseManager {
}),

TestCase(title: "Video Outstream (GAM Original) [OK, PUC]",
tags: [.banner, .originalAPI, .server],
tags: [.video, .originalAPI, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in

Expand Down Expand Up @@ -411,6 +412,25 @@ struct TestCaseManager {
setupCustomParams(for: interstitialController.prebidConfigId)
}),

TestCase(title: "Display Interstitial 320x480 SKAdN (GAM Original) [OK, PUC]",
tags: [.interstitial, .originalAPI, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in

guard let adapterVC = vc as? AdapterViewController else {
return
}

let interstitialController = PrebidOriginalAPIDisplayInterstitialController(rootController: adapterVC)
interstitialController.prebidConfigId = "prebid-demo-display-interstitial-320-480-skadn"
interstitialController.adUnitID = "/21808260008/prebid-demo-app-original-api-display-interstitial"
interstitialController.activatePrebidSKAdN = true

adapterVC.setup(adapter: interstitialController)

setupCustomParams(for: interstitialController.prebidConfigId)
}),

TestCase(title: "Video Interstitial 320x480 (GAM Original) [OK, PUC]",
tags: [.interstitial, .originalAPI, .server, .video],
exampleVCStoryboardID: "AdapterViewController",
Expand Down Expand Up @@ -512,7 +532,7 @@ struct TestCaseManager {
setupCustomParams(for: nativeController.prebidConfigId)
}),

TestCase(title: "Native In-App (GAM Original) [OK, PUC]",
TestCase(title: "Native In-App (GAM Original) [OK]",
tags: [.native, .originalAPI, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in
Expand All @@ -533,6 +553,27 @@ struct TestCaseManager {
setupCustomParams(for: nativeController.prebidConfigId)
}),

TestCase(title: "Native In-App SKAdN (GAM Original) [OK]",
tags: [.native, .originalAPI, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in

guard let adapterVC = vc as? AdapterViewController else {
return
}

let nativeController = PrebidOriginalAPINativeController(rootController: adapterVC)
nativeController.setupNativeAdView(NativeAdViewBox())

nativeController.adUnitID = "/21808260008/apollo_custom_template_native_ad_unit"
nativeController.prebidConfigId = "prebid-demo-banner-native-styles-skadn"
nativeController.nativeAssets = .defaultNativeRequestAssets
nativeController.eventTrackers = .defaultNativeEventTrackers

adapterVC.setup(adapter: nativeController)
setupCustomParams(for: nativeController.prebidConfigId)
}),

// MARK: ---- In-Stream (Original API)

TestCase(title: "Instream Video (GAM Original) [OK, PUC]",
Expand Down Expand Up @@ -839,7 +880,7 @@ struct TestCaseManager {
}),

// NOTE: works only with InternalTestApp-Skadn target
TestCase(title: "Banner 320x50 (In-App) [SKAdN]",
TestCase(title: "Banner 320x50 SKAdN (In-App) [OK]",
tags: [.banner, .inapp, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in
Expand Down Expand Up @@ -1115,7 +1156,7 @@ struct TestCaseManager {
}),

// NOTE: works only with InternalTestApp-Skadn target
TestCase(title: "Display Interstitial 320x480 (In-App) [SKAdN]",
TestCase(title: "Display Interstitial 320x480 SKAdN (In-App) [OK]",
tags: [.interstitial, .inapp, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in
Expand Down Expand Up @@ -1598,7 +1639,7 @@ struct TestCaseManager {
}),

// NOTE: works only with InternalTestApp-Skadn target
TestCase(title: "Video Interstitial 320x480 (In-App) [SKAdN]",
TestCase(title: "Video Interstitial 320x480 SKAdN (In-App) [OK]",
tags: [.video, .inapp, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in
Expand Down Expand Up @@ -1904,7 +1945,7 @@ struct TestCaseManager {
}),

// NOTE: works only with InternalTestApp-Skadn target
TestCase(title: "Video Outstream (In-App) [SKAdN]",
TestCase(title: "Video Outstream SKAdN (In-App) [OK]",
tags: [.video, .inapp, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in
Expand Down Expand Up @@ -2164,7 +2205,7 @@ struct TestCaseManager {
}),

// NOTE: works only with InternalTestApp-Skadn target
TestCase(title: "Video Rewarded Time 320x480 (In-App, SKAdN)",
TestCase(title: "Video Rewarded Time 320x480 SKAdN (In-App) [OK]",
tags: [.interstitial, .video, .inapp, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class PrebidOriginalAPIDisplayBannerController:
var gamSizes = [AdSize]()

// Prebid
var activatePrebidSKAdN = false

private var adUnit: BannerAdUnit!

// GAM
Expand Down Expand Up @@ -61,6 +63,10 @@ class PrebidOriginalAPIDisplayBannerController:
setupAdapterController()
}

deinit {
Targeting.shared.sourceapp = nil
}

func configurationController() -> BaseConfigurationController? {
return PrebidBannerConfigurationController(controller: self)
}
Expand Down Expand Up @@ -185,6 +191,10 @@ class PrebidOriginalAPIDisplayBannerController:
rootController?.bannerView.constraints.first { $0.firstAttribute == .width }?.constant = bannerView.adSize.size.width
rootController?.bannerView.constraints.first { $0.firstAttribute == .height }?.constant = bannerView.adSize.size.height

if activatePrebidSKAdN {
adUnit.activatePrebidSKAdNetworkStoreKitAdsFlow(adView: gamBanner)
}

AdViewUtils.findPrebidCreativeSize(bannerView, success: { size in
guard let bannerView = bannerView as? AdManagerBannerView else { return }
bannerView.resize(adSizeFor(cgSize: size))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class PrebidOriginalAPIDisplayInterstitialController:

var refreshInterval: TimeInterval = 0

var activatePrebidSKAdN = false

// Prebid
private var adUnit: InterstitialAdUnit!

Expand Down Expand Up @@ -158,6 +160,11 @@ class PrebidOriginalAPIDisplayInterstitialController:
@IBAction func showButtonClicked() {
if let gamInterstitial = gamInterstitial {
rootController?.showButton.isEnabled = false

if activatePrebidSKAdN {
adUnit.activatePrebidSKAdNetworkStoreKitAdsFlow()
}

gamInterstitial.present(from: rootController!)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class PrebidOriginalAPIVideoBannerController:
var adSize = CGSize.zero
var gamSizes = [AdSize]()

// Prebid
private var adUnit: VideoAdUnit!

// GAM
Expand Down
3 changes: 1 addition & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ DEPENDENCIES:
- AppLovinSDK
- Eureka
- Google-Mobile-Ads-SDK
- Google-Mobile-Ads-SDK (<= 11.13.0)
- GoogleAds-IMA-iOS-SDK
- RxSwift
- SVProgressHUD
Expand All @@ -42,6 +41,6 @@ SPEC CHECKSUMS:
RxSwift: 31649ace6aceeb422e16ff71c60804f9c3281ed9
SVProgressHUD: 4837c74bdfe2e51e8821c397825996a8d7de6e22

PODFILE CHECKSUM: df50580a1f6c422298edf0513ce00e759ea4668a
PODFILE CHECKSUM: bae4436ed691a1d2217fde386d8881d6e7e06963

COCOAPODS: 1.16.2
Loading