构建出Xcode代码,按照google官方文档导入google ads的SDK
Js中创建1个点击按钮,
ShowInitAdsinitAds() {
jsb.reflection.callStaticMethod("RootViewController", "ShowInitAdsinitAds");
}
在RootViewController.h中添加类方法
+(void)ShowInitAdsinitAds;
在RootViewController.m中去实现
+(void)ShowInitAdsinitAds{
[[NSNotificationCenter defaultCenter] postNotificationName:@"interstitialAds" object:nil];
}
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showInterstitialAds) name:@"interstitialAds" object:nil];
}
#pragma mark -- 插页 广告
- (void)showInterstitialAds{