iOS) Can admanager use banner ads and admob use native ads?

65 views
Skip to first unread message

Myoungkyu Shin

unread,
Feb 27, 2024, 5:34:59 AM2/27/24
to Google Mobile Ads SDK Developers
Hello! Google Mobile Ads team, This is MK.
Currently, I am publishing native ad/banner ad advertisements using AdManager.
The code I am using is as follows.

final class GoogleADLoader {
let adUnitID: String
let rootViewController: UIViewController
let widthOfBannerSize: CGFloat

private lazy var adLoader: GADAdLoader = {
let adLoader = GADAdLoader(
adUnitID: self.adUnitID,
rootViewController: self.rootViewController,
adTypes: [.native, .gamBanner],
options: nil
)
adLoader.delegate = self
return adLoader
}()

init(adUnitID: String, rootViewController: UIViewController) {
self.adUnitID = adUnitID
self.rootViewController = rootViewController
self.widthOfBannerSize = rootViewController.view.window?.windowScene?.screen.fixedCoordinateSpace.bounds.width ?? 0
}

func fetchAD(
with contentURLStrings: [String],
customTargetings: [String: String]
) {
let gamRequest = GAMRequest()
gamRequest.neighboringContentURLStrings = contentURLStrings
gamRequest.customTargeting = customTargetings

adLoader.load(gamRequest)
}
}

extension GoogleADLoader: GADAdLoaderDelegate {
public func adLoader(_ adLoader: GADAdLoader, didFailToReceiveAdWithError error: any Error) {
print(error)
}
public func adLoaderDidFinishLoading(_ adLoader: GADAdLoader) {}
}

extension GoogleADLoader: GADNativeAdLoaderDelegate {
public func adLoader(_ adLoader: GADAdLoader, didReceive nativeAd: GADNativeAd) {
print(nativeAd)
}
}

extension GoogleADLoader: GAMBannerAdLoaderDelegate {
public func adLoader(_ adLoader: GADAdLoader, didReceive bannerView: GAMBannerView) {
print(bannerView)
}

public func validBannerSizes(for adLoader: GADAdLoader) -> [NSValue] {
[NSValueFromGADAdSize(GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(widthOfBannerSize))]
}
}


In this structure, is it possible to call only banner ads with AdManager and only native ads with AdMob?
If possible, I would like to know how.

Thank you for always responding kindly.

Mobile Ads SDK Forum Advisor

unread,
Feb 27, 2024, 12:17:15 PM2/27/24
to ikaru...@gmail.com, google-adm...@googlegroups.com

Hi MK,

Thank you for contacting the Mobile Ads SDK support team.

After your concern is reviewed, I understand that you wanted to know whether an AdManager Can use banner ads and AdMob can use native ads.

Yes, You can Mix native and banner for iOS apps. To mix native and banner when using the Android & iOS app code option, use the Google Mobile Ads SDK to request an ad that is either native or banner as long as it fits in the given ad unit. Learn more in the developer documentation for iOS. However, it is not possible to call only banner ads with AdManager and only native ads with AdMob collectively in the same request.

I hope this helps! Let me know if you have any other questions. 

This message is in relation to case "ref:!00D1U01174p.!5004Q02rzThS:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Myoungkyu Shin

unread,
Feb 27, 2024, 9:14:09 PM2/27/24
to Google Mobile Ads SDK Developers
Thank you for your kind guidance. 
The document you shared is about AdManager. 

Can AdMob also use GADAdLoader to use both nativead and banner ad?
let adLoader = GADAdLoader(
adUnitID: self.adUnitID,
rootViewController: self.rootViewController,
adTypes: [.native, .gamBanner],
options: nil
)
2024년 2월 28일 수요일 오전 2시 17분 15초 UTC+9에 Mobile Ads SDK Forum Advisor님이 작성:

Mobile Ads SDK Forum Advisor

unread,
Feb 28, 2024, 1:38:01 AM2/28/24
to ikaru...@gmail.com, google-adm...@googlegroups.com
Hi, 

Thank you for getting back to us.

Yes, the document that's shared is of Google Ad Manager. However, it is not possible to call banner ads and native ads with AdMob collectively in the same request.
Reply all
Reply to author
Forward
0 new messages