gpt4 book ai didi

ios - 如何将测试 RevMobAds 转换为生产

转载 作者:行者123 更新时间:2023-11-28 19:02:25 25 4
gpt4 key购买 nike

我第一次在我的应用程序中使用 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。

步骤:2AppDelegate方法导入 #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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com