SDK Documentation
HomeBlogSign up
English
English
  • 🏠Homepage
  • 🧪Test Ad Units
  • Privacy
    • ✅Google Data Safety
  • Android SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
    • 🛠️ProGuard
  • iOS SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Revenue reporting
    • 🙍User consent
    • 🔓Privacy
  • Unity SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • Flutter SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • React Native
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • Web SDK
    • ⌨️SDK integration
Con tecnología de GitBook
En esta página
  • Integration
  • Specify options
  1. iOS SDK
  2. SDK integration

Native (Google)

The native ads are a kind of ad that can be shown using the same visual style like the rest of the app, which allows a natural and non-intrusive integration with the user interface.

Currently, Wortise provides the possibility of use the native ads from Google's ad platform ("Native Advanced"), in a simple and direct way.

Integration

To request a native ad, it is needed to make an integration by code just as shown in the example below:

import UIKit
import WortiseSDK

class ViewController: UIViewController {
    private var nativeAd: WAGoogleNativeAd!

    override func viewDidLoad() {
        super.viewDidLoad()
        ...
        nativeAd = WAGoogleNativeAd(adUnitId: "test-native",
                                    rootViewController: self,
                                    delegate: self)
        nativeAd.loadAd()
    }

    override func willMove(toParent controller: UIViewController?) {
        super.willMove(toParent: controller)
        ...
        nativeAd.destroy()
    }
}

extension ViewController: WAGoogleNativeDelegate {

    func didClick(nativeAd: WAGoogleNativeAd) {
        // Invoked when the ad has been clicked
    }

    func didFailToLoad(nativeAd: WAGoogleNativeAd, error: WAAdError) {
        // Invoked when the ad could not be loaded
        // (because of an error or no fill)
    }

    func didLoad(nativeAd: WAGoogleNativeAd, googleNativeAd: GADNativeAd) {
        // Invoked when the ad has been loaded
    }
    
    func didPayRevenue(nativeAd: WAGoogleNativeAd, data: WARevenuedata) {
        // Invoked when the ad has generated revenue
    }

    func didRecord(impression: WAGoogleNativeAd) {
        // Invoked when the ad has generated an impression
    }
}

Specify options

The WAGoogleNativeAd class includes an attribute called options which allows to specify custom options by using the GADAdLoaderOptions class from Google. This attribute must be set before loading the ad.

Below you can check a brief usage example:

let adOptions = GADNativeAdViewAdOptions()

// Set the options through "adOptions"

googleNativeAd.options = adOptions
AnteriorRewardedSiguienteRevenue reporting

Última actualización hace 3 días

Once the native ad has been successfully loaded, obtaining as result a GADNativeAd instance, it is needed to complete the integration by following Google's documentation on this matter:

⌨️
https://developers.google.com/ad-manager/mobile-ads-sdk/ios/native/advanced?hl=en#display_a_nativead