以下是我用于在我的应用中制作广告的代码。我正在使用Swift在SpriteKit中编程,我正在尝试实施应用程序内购买,以便在支付99美分时禁用iAd。我该怎么做呢?
以下是制作广告的代码:
class GameViewController: UIViewController, ADBannerViewDelegate {
var bannerView:ADBannerView?
override func viewDidLoad() {
super.viewDidLoad()
//enable banner ads
super.viewDidLoad()
self.canDisplayBannerAds = true
self.bannerView?.delegate = self
self.bannerView?.hidden = true
}
//if banner ad exists, put it on the screen
func bannerViewDidLoadAd(banner: ADBannerView!) {
self.bannerView?.hidden = false
}
//if tapped banner ad, make it full-screen
func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -> Bool {
return willLeave
}
//if there is no banner ad, take it away
func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
self.bannerView?.hidden = true
}
}
我如何实施一个按钮,按下该按钮,向用户收取99¢并删除所有广告?