请尝试这样:
步骤:1添加 RevMovAds.framework。
步骤:2在AppDelegate
方法导入中#import <RevMobAds/RevMobAds.h>
步骤:3添加Delegate
方法"RevMobAdsDelegate"
步骤:4#define REVMOB_ID @"52f073fa09e95bbb02000761"
在 Prefix.pch 中定义
(在 RevMobAds 网站上创建一个帐户并为您的应用程序获取 REVMOB_ID)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[RevMobAds startSessionWithAppID:REVMOB_ID];
return YES;
}
步骤:5声明方法
-(void)ForshowingFullScreenAds
{
RevMobFullscreen *fullscreen = [[RevMobAds session] fullscreen];
fullscreen.delegate = self;
[fullscreen loadAd];
[fullscreen showAd];
}
步骤:6 RevMobAdsDelegate
种方法
- (void)revmobAdDidReceive
{
NSLog(@"[RevMob Sample App] Ad loaded.");
}
- (void)revmobAdDidFailWithError:(NSError *)error
{
NSLog(@"[RevMob Sample App] Ad failed: %@", error);
}
- (void)revmobAdDisplayed {
NSLog(@"[RevMob Sample App] Ad displayed.");
}
- (void)revmobUserClosedTheAd {
NSLog(@"[RevMob Sample App] User clicked in the close button.");
}
- (void)revmobUserClickedInTheAd {
NSLog(@"[RevMob Sample App] User clicked in the Ad.");
}
- (void)installDidReceive {
NSLog(@"[RevMob Sample App] Install did receive.");
}
- (void)installDidFail {
NSLog(@"[RevMob Sample App] Install did fail.");
}
步骤:7导入AppDelegate
方法
步骤:8调用此广告-(void)ViewDidLoad
AppController *App = (AppController *)[UIApplication sharedApplication].delegate;
[App ForshowingFullScreenAds];