アプリデリゲートからインタースティシャル広告を実装していて、うまく読み込んでいます。今私はそれを削除する購入ボタンが欲しい、と私は混乱しています。アプリデリゲートアプリの購入からインタースティシャル広告を削除する方法
class AppDelegate: UIResponder, UIApplicationDelegate, GADInterstitialDelegate {
var window: UIWindow?
var myInterstitial: GADInterstitial!
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
myInterstitial = createAndLoadInterstitial()
return true
}
func createAndLoadInterstitial()->GADInterstitial {
let interstitial = GADInterstitial(adUnitID: "xxxxx")
interstitial.delegate = self
interstitial.loadRequest(GADRequest())
return interstitial
}
func interstitialDidReceiveAd(ad: GADInterstitial!) {
print("interstitialDidReceiveAd")
}
func interstitial(ad: GADInterstitial!, didFailToReceiveAdWithError error: GADRequestError!) {
print(error.localizedDescription)
}
func interstitialDidDismissScreen(ad: GADInterstitial!) {
print("interstitialDidDismissScreen")
myInterstitial = createAndLoadInterstitial()
}
とのViewController:
let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
override func viewWillAppear(animated: Bool) {
appDelegate.myInterstitial?.presentFromRootViewController(self)
}
そして、あなたがについて混乱何ですか?本当の質問は何ですか? – Losiowaty
広告を削除するにはどうすればいいですか? – Done