作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我第一次在我的应用程序中使用 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 添加 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;
}
Step: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];
关于ios - 如何将测试 RevMobAds 转换为生产,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23672629/
我是一名优秀的程序员,十分优秀!