我正在使用雪碧工具包编写我的应用程序,我使用iAd作为我的广告。我使用了当前的代码来实现全屏广告:
interstitial = [[ADInterstitialAd alloc] init];
interstitial.delegate = self;
CGRect interstitialFrame = self.frame;
UIView *adView = [[UIView alloc] initWithFrame:interstitialFrame];
[view addSubview:adView];
[interstitial presentInView:adView];这是我的GameScene.m课程。它工作,它显示了一个全屏幕广告,这是唯一的实施Interstitial广告,我已经有工作到目前为止。
当我运行应用程序时,它会显示一个全屏广告(这正是我想要的),但是没有退出按钮?我不确定当实际的应用程序被发布到应用商店时,这种情况是否会改变?
所以我的问题是。
发布于 2015-11-02 21:52:02
你为什么要为你自己的惰性创造一个视图呢?
使用
ADInterstitialPresentationPolicy.Automatic
利用iAd框架的逻辑构建。这也会给广告添加一个退出按钮,
下面是我的示例代码的一个SWIFT版本
override func viewDidLoad() {
super.viewDidLoad()
// Initialize the Ad
UIViewController.prepareInterstitialAds()
}
func showAd() {
self.interstitialPresentationPolicy = ADInterstitialPresentationPolicy.Automatic
}完整的教程可以在这里找到:快速提示:在SWIFT中为iOS实现全屏(间隙)广告
https://stackoverflow.com/questions/33426770
复制相似问题