Native (Google)
Integration
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
Última actualización