Estou tentando incluir um iAD fullscreen em um app, mas a tela de propaganda está aparecendo sem o botão de fechar, a duvida é se tenho que fazer ele a mão ou tem alguma opção oculta para isso?
Encontrei coisas mais antigas sobre isso, mas não sei se ainda refletem a realidade atual.
Segue a base do código que estou utilizando, mas em um arquivo "vazio".
import UIKit
import iAd
class ViewController: UIViewController, ADInterstitialAdDelegate{
var interstitialAd:ADInterstitialAd!
var interstitialAdView: UIView = UIView()
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
@IBAction func chamarIAd(sender: AnyObject) {
loadInterstitialAd()
}
func loadInterstitialAd() {
println("loadInterstitialAd")
interstitialAd = ADInterstitialAd()
interstitialAd.delegate = self
}
func interstitialAdWillLoad(interstitialAd: ADInterstitialAd!) {
println("interstitialAdWillLoad")
}
func interstitialAdDidLoad(interstitialAd: ADInterstitialAd!) {
println("interstitialAdDidLoad")
interstitialAdView = UIView()
interstitialAdView.frame = self.view.bounds
view.addSubview(interstitialAdView)
interstitialAd.presentInView(interstitialAdView)
UIViewController.prepareInterstitialAds()
}
func interstitialAdActionDidFinish(interstitialAd: ADInterstitialAd!) {
println("interstitialAdActionDidFinish")
interstitialAdView.removeFromSuperview()
}
func interstitialAdActionShouldBegin(interstitialAd: ADInterstitialAd!, willLeaveApplication willLeave: Bool) -> Bool {
println("interstitialAdActionShouldBegin")
return true
}
func interstitialAd(interstitialAd: ADInterstitialAd!, didFailWithError error: NSError!) {
println("interstitialAd")
}
func interstitialAdDidUnload(interstitialAd: ADInterstitialAd!) {
println("interstitialAdDidUnload")
interstitialAdView.removeFromSuperview()
}
}