我是iOS游戏开发的新手。我正在开发一个儿童应用程序,并在该应用程序中集成admob广告。当用户点击广告时,我必须检测触摸事件。因为当用户点击该广告时,用户会首先看到家长控制。
您使用的是哪个软件开发工具包(SDK)?假设您使用的是最新的6.11.1版本,通常情况下应将您的类实现为GADBannerViewDelegate或GADInterstitialDelegate的委托(请参阅Google文档):
YourClass.h:
@interface YourClass : SuperClass <GADBannerViewDelegate, GADInterstitialDelegate> {
}
YourClass.m:
// onAdOpened
- (void)adViewWillPresentScreen:(GADBannerView *)adView {
<your code here>
}
// onAdLeftApplication
- (void)adViewWillLeaveApplication:(GADBannerView *)adView {
<your code here>
}