전면
import UIKit
import AdWhaleSDK
class ViewController: UIViewController {
var interstitialAd: AdWhaleInterstitialAd?
override func viewDidLoad() {
super.viewDidLoad()
let interstitialAd = AdWhaleInterstitialAd()
interstitialAd.interstitialDelegate = self
// Interstitial Ad Request
interstitialAd.load("전면 광고 AD_UNIT_ID 입력")
}
@IBAction func interstitialAdShow(_ sender: UIButton) {
interstitialAd?.show(self)
}
}
// MARK: InterstitialAd Delegate
extension ViewController: AdWhaleInterstitialDelegate {
func adDidReceiveInterstitialAd(_ ad: AdWhaleSDK.AdWhaleInterstitialAd) {
print("adWhale Sample adDidReceiveInterstitialAd")
interstitialAd = ad
}
func adDidFailToReceiveInterstitialAdWithError(_ error: Error) {
print("adWhale Sample adDidFailToReceiveInterstitialAdWithError")
}
func ad(_ ad: AdWhaleSDK.AdWhaleInterstitialAd, didFailToPresentInterstitialAdWithError error: Error) {
print("adWhale Sample didFailToPresentInterstitialAdWithError")
}
func adWillPresentInterstitialAd(_ ad: AdWhaleSDK.AdWhaleInterstitialAd) {
print("adWhale Ad will present Interstitial ad.")
}
func adDidDismissInterstitialAd(_ ad: AdWhaleSDK.AdWhaleInterstitialAd) {
print("adWhale Ad did dismiss Interstitial ad.")
}
}Last updated