Os anúncios nativos renderizados de forma personalizada são carregados via objetos
GADAdLoader. O objeto GADAdLoader também pode ser configurado para fazer solicitações de anúncios
que podem resultar em um banner ou um anúncio nativo. Ao adicionar GADAdLoaderAdTypeGAMBanner ao parâmetro de matriz adTypes, junto com tipos de anúncios nativos, como GADAdLoaderAdTypeNative, ao criar o objeto GADAdLoader, você especifica que os anúncios de banner devem competir com os anúncios nativos para atender à solicitação.
Além disso, os banners carregados por objetos GADAdLoader não serão atualizados.
GAMBannerAdLoaderDelegate
Ao solicitar anúncios de banner usando o GADAdLoader, o delegado do carregador de anúncios precisa
estar em conformidade com o protocolo GAMBannerAdLoaderDelegate. Esse protocolo inclui uma mensagem enviada quando um anúncio de banner é carregado:
O delegado do carregador de anúncios também precisa especificar quais tamanhos de banner devem ser
solicitados respondendo à mensagem validBannerSizesForAdLoader, conforme mostrado
abaixo.
Para ativar a contagem manual de impressões em anúncios de banner carregados pelo GADAdLoader, defina um GAMBannerViewOptions com enableManualImpressions definido como YES ao inicializar o GADAdLoader.
Se um anúncio de banner for carregado, chame recordManualImpression quando determinar que um anúncio foi retornado e está na tela para acionar manualmente uma impressão:
[null,null,["Última atualização 2025-08-27 UTC."],[[["\u003cp\u003eYou can combine native and banner ads in your ad requests by including both \u003ccode\u003eGADAdLoaderAdTypeNative\u003c/code\u003e and \u003ccode\u003eGADAdLoaderAdTypeGAMBanner\u003c/code\u003e when creating a \u003ccode\u003eGADAdLoader\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eTo receive banner ads through a \u003ccode\u003eGADAdLoader\u003c/code\u003e, your ad loader delegate must conform to the \u003ccode\u003eGAMBannerAdLoaderDelegate\u003c/code\u003e protocol and specify the desired banner ad sizes.\u003c/p\u003e\n"],["\u003cp\u003eWhen loading banner ads via \u003ccode\u003eGADAdLoader\u003c/code\u003e, manual impression counting can be enabled using \u003ccode\u003eGAMBannerViewOptions\u003c/code\u003e and calling \u003ccode\u003erecordManualImpression\u003c/code\u003e when the ad is displayed.\u003c/p\u003e\n"],["\u003cp\u003eRemember that banner ads loaded through \u003ccode\u003eGADAdLoader\u003c/code\u003e will not refresh and that requesting banners alone requires following the separate banner guide.\u003c/p\u003e\n"]]],[],null,["With a few changes to your code, you can combine native and banner ads in your\nad requests.\n\nPrerequisites\n\n- Version 7.20.0 or higher of the Google Mobile Ads SDK\n- Complete the [Get Started](/ad-manager/mobile-ads-sdk/ios/quick-start) guide\n\nLoading an ad\n\nCustom-rendered native ads are loaded via\n[`GADAdLoader`](/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADAdLoader)\nobjects. The `GADAdLoader` object can also be configured to make ad requests\nthat can result in either a banner or native ad. Adding\n`GADAdLoaderAdTypeGAMBanner` to the `adTypes` array parameter, along with\nnative ad types such as `GADAdLoaderAdTypeNative` when creating the\n`GADAdLoader` object specifies that banner ads should compete with native ads\nto fill the request. \n\nSwift \n\n```swift\nadLoader = GADAdLoader(adUnitID: \"/21775744923/example/native-and-banner\",\n rootViewController: self,\n adTypes: [.native, .gamBanner],\n options: [... ad loader options objects ...])\nadLoader.delegate = self\n```\n\nObjective-C \n\n```objective-c\nself.adLoader = [[GADAdLoader alloc]\n initWithAdUnitID:@\"/21775744923/example/native-and-banner\"\n rootViewController:rootViewController\n adTypes:@[ GADAdLoaderAdTypeNative, GADAdLoaderAdTypeGAMBanner ]\n options:@[ ... ad loader options objects ... ]];\nself.adLoader.delegate = self;\n```\n| **Note:** Banner ads can only be loaded via `GADAdLoader` objects when requested alongside native ads. To make an ad request for banners alone, follow the steps outlined in the in the [banner guide](/ad-manager/mobile-ads-sdk/ios/banner). In addition, banners loaded via `GADAdLoader` objects will not refresh.\n\nGAMBannerAdLoaderDelegate\n\nWhen requesting banner ads via the `GADAdLoader`, the ad loader delegate must\nconform to the `GAMBannerAdLoaderDelegate` protocol. This protocol includes a\nmessage that's sent when a banner ad has loaded: \n\nSwift \n\n```swift\npublic func adLoader(_ adLoader: GADAdLoader,\n didReceive GAMBannerView: GAMBannerView)\n```\n\nObjective-C \n\n```objective-c\n- (void)adLoader:(GADAdLoader *)adLoader didReceiveGAMBannerView:(GAMBannerView *)bannerView;\n```\n\nThe ad loader delegate must also specify which banner ad sizes should be\nrequested by responding to the `validBannerSizesForAdLoader` message as shown\nbelow. \n\nSwift \n\n```swift\npublic func validBannerSizes(for adLoader: GADAdLoader) -\u003e [NSValue] {\n return [NSValueFromGADAdSize(GADAdSizeBanner),\n NSValueFromGADAdSize(GADAdSizeMediumRectangle),\n NSValueFromGADAdSize(GADAdSizeFromCGSize(CGSize(width: 120, height: 20)))]\n}\n```\n\nObjective-C \n\n```objective-c\n- (NSArray *)validBannerSizesForAdLoader:(GADAdLoader *)adLoader {\n return @[\n @(GADAdSizeBanner),\n @(GADAdSizeMediumRectangle),\n @(GADAdSizeFromCGSize(CGSizeMake(120, 20)))\n ];\n}\n```\n| **Note:** Don't create your own `GADAdSize` directly. Use one of the predefined ad sizes (such as `GADAdSizeBanner`), or create one using the `GADAdSizeFromCGSize` method, as shown above.\n\nManual impression counting\n\nTo enable [manual impression\ncounting](/ad-manager/mobile-ads-sdk/ios/banner#manual_impression_counting)\non banner ads loaded through `GADAdLoader`, set a\n[`GAMBannerViewOptions`](/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GAMBannerViewOptions)\nwith `enableManualImpressions` set to `YES` when initializing `GADAdLoader`. \n\nSwift \n\n```swift\nlet bannerViewOptions = GAMBannerViewOptions()\nbannerViewOptions.enableManualImpressions = true\nadLoader = GADAdLoader(\n adUnitID: \"/21775744923/example/native-and-banner\", rootViewController: self,\n adTypes: [.native, .gamBanner], options: [bannerViewOptions])\n```\n\nObjective-C \n\n```objective-c\nGAMBannerViewOptions *bannerViewOptions = [[GAMBannerViewOptions alloc] init];\nbannerViewOptions.enableManualImpressions = YES;\nself.adLoader = [[GADAdLoader alloc]\n initWithAdUnitID:@\"/21775744923/example/native-and-banner\"\n rootViewController:self\n adTypes:@[ GADAdLoaderAdTypeNative, GADAdLoaderAdTypeGAMBanner ]\n options:@[ bannerViewOptions ]];\n```\n\nIf a banner ad loads, you can call `recordManualImpression` when you\ndetermine that an ad has been successfully returned and is on-screen to\nmanually fire an impression: \n\nSwift \n\n```swift\nbannerView.recordImpression()\n```\n\nObjective-C \n\n```objective-c\n[self.bannerView recordImpression];\n```"]]