如何将测试RevMobAds转换为生产

时间:2014-05-15 08:10:12

标签: ios revmobads

我使用此代码首次在我的应用中使用RevMobAds

[RevMobAds startSessionWithAppID:@" "];
[RevMobAds session].testingMode = RevMobAdsTestingModeWithAds;
[[RevMobAds session]hideBanner];

RevMobBannerView  ad = [[RevMobAds session] bannerView];

ad.delegate = self;
[ad loadAd];
ad.frame=CGRectMake(00, 430, 320, 50);

[self.view addSubview:ad];`

问题是这个横幅中没有添加任何内容。请帮助我。

1 个答案:

答案 0 :(得分:4)

请尝试这样:

步骤:1 添加RevMovAds.framework。

步骤:2 AppDelegate方法导入#import <RevMobAds/RevMobAds.h>

步骤:3 添加Delegate方法"RevMobAdsDelegate"

步骤:4 在Prefix.pch中定义#define REVMOB_ID @"52f073fa09e95bbb02000761"

(在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];