- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
在模拟器和设备上运行时,我在控制台中收到 didFailToReceiveAdWithError
消息。
iAd banners 在 iOS 8 上运行时显示成功。在 iOS 9 上运行时,iAd banners 接收不到广告。
.h
#import <iAd/iAd.h>
@interface ViewController : UIViewController <ADBannerViewDelegate>
@property (retain, nonatomic) IBOutlet ADBannerView *adBanner;
.m
-(void)viewDidLoad {
self.adBanner = [[ADBannerView alloc]initWithFrame:CGRectMake(0,[UIScreen mainScreen].bounds.size.height-100, [UIScreen mainScreen].bounds.size.width, 50)];
self.adBanner.delegate=self;
[self.adBanner setBackgroundColor:[UIColor clearColor]];
[self.view addSubview:self.adBanner];
}
-(void)bannerViewWillLoadAd:(ADBannerView *)banner {
NSLog(@"bannerViewWillLoadAd");
}
-(void)bannerViewDidLoadAd:(ADBannerView *)banner {
// Show the ad banner.
NSLog(@"bannerViewDidLoadAd");
[UIView animateWithDuration:0.5 animations:^{
self.adBanner.alpha = 1.0;
}];
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
NSLog(@"didFailToReceiveAdWithError");
// Hide the ad banner.
[UIView animateWithDuration:0.5 animations:^{
self.adBanner.alpha = 0.0;
}];
}
-(void)bannerViewActionDidFinish:(ADBannerView *)banner {
NSLog(@"Ad did finish");
}
在iOS 9上运行时,控制台每次都会打印didFailToReceiveAdWithError
。
最佳答案
我无法重现您的问题。测试时 iAd 网络可能在您所在的国家/地区出现故障,您所在的国家/地区可能 iAd 不支持,或者您在开发设备/模拟器上将 iAd 测试填充率设置为 0%。转到设置>开发人员>填充率>并检查您的开发设备/模拟器上的填充率是否设置为 100%。
我建议打印 error
你收到 didFailToReceiveAdWithError
这样你就可以找出为什么 ADBannerView
失败了。
-(void)viewDidLoad {
// The ADBannerView will size itself based on the device it is being displayed on
// Only setting the position is sufficient
self.adBanner = [[ADBannerView alloc]initWithFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.height-100, 0, 0)];
self.adBanner.delegate=self;
// Removed setBackgroundColor
// Set alpha to 0.0 initially
self.adBanner.alpha = 0.0;
[self.view addSubview:self.adBanner];
}
-(void)bannerViewWillLoadAd:(ADBannerView *)banner {
NSLog(@"bannerViewWillLoadAd");
}
-(void)bannerViewDidLoadAd:(ADBannerView *)banner {
NSLog(@"bannerViewDidLoadAd");
[UIView animateWithDuration:0.5 animations:^{
self.adBanner.alpha = 1.0;
}];
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
// Changed NSLog to print the error that is received
NSLog(@"didFailToReceiveAdWithError: %@", error);
[UIView animateWithDuration:0.5 animations:^{
self.adBanner.alpha = 0.0;
}];
}
-(void)bannerViewActionDidFinish:(ADBannerView *)banner{
NSLog(@"bannerViewActionDidFinish");
}
如果您仍然遇到此问题,您应该 contact iAd直接并根据他们的回答更新您的问题,或者在他们能够为您解决的情况下发布答案。
关于ios - iAd 横幅不适用于 iOS 9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34238980/
我制作了一个加载苹果测试广告的测试应用程序。我想知道如何加载实时广告而不是苹果测试广告。加载实时 iAd 的机制是什么?任何人都可以在这方面帮助我吗? 问候阿卜杜勒·萨马德 最佳答案 作为docume
我刚刚将 iAd 添加到我的一个应用程序中,它工作正常,只是它在横幅 View 的顶部和底部留下了空白。有谁知道如何摆脱它? 截图如下: 最佳答案 你在使用 Storyboard吗?如果可能的话,您已
You are receiving this email because you entered into the Developer Advertising Services Agreement (
我想知道使用过 iAds 的人是否知道没有广告返回的频率 当我们收到“无广告”委托(delegate)回调时,我们正在讨论是否使用替代广告平台 - (void)bannerView:(ADBanner
我在 iAd 不支持的中国,但我想嵌入 iAd,因为我的应用程序是全局性的。我知道只有美国、英国、日本......可以展示 iAd。 如果我在中国,如何向 iAd 发送短信? 或者,如果我是位于中国的
我已经创建了一个 iOS6“单一 View ”iPhone 应用程序。 应用程序只有纵向。 我在应用程序中添加了 iAds。 我像这样向应用程序添加额外的 View : if (se
You are receiving this email because you entered into the Developer Advertising Services Agreement (
我开发了这款游戏,它运行良好,就像我想要的那样,但在我添加 iAd 横幅后,当我开始游戏时,它会正常运行大约 10 秒。然后它放大并使所有东西都变得非常大,然后它会给我这个错误: Shapes#2[7
我是第一次使用 iAd,我已成功将应用程序与 iAd 集成。现在它完成了它工作正常显示演示 iAd 横幅。如何使用 iAd 网络显示广告,我找不到任何连接 iAd 应用程序的教程。是否需要创建任何 I
如果 iAds 横幅不改变场景,我无法将 iAds 实现到游戏中,例如每次加载广告时都会抖动屏幕。请提供解决方案以阻止这种情况发生。 class GameViewController: UIViewC
我已经以这种方式构建了我的应用程序,一切似乎或多或少都正常工作。在听说 iAd 填充率极低之后,我认为这将是最好的方法,但我尝试用谷歌搜索它,但找不到其他人在他们的应用程序中像这样实现广告的记录。这是
我正在尝试在 iOS 设备上测试 iAd,2013 年的一些帖子说您需要在 iTunes Connect 中“设置 iAd 网络”。我在 Itunes connect 中看不到任何此类选项。 itun
我已经复制了 iAdSuite with Storyboards在 swift 中,iAd 在所有 View Controller 上工作正常,除了当委托(delegate)方法 bannerView
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit
这仍然是一个相对较新的话题,所以不确定有多少人在 iPad (iOS4.2.1) 上实现了 iAd。 但基本上,我让 iAd 横幅以横向模式显示(并且显示正确)。唯一的问题是当我点击“测试广告”时,它
我搜索了一段时间,同时寻找有关如何在 iAds 失败时将 iAds 与 AdMobs 集成的完整指南, 我问这个问题的唯一原因是我有 iAds,我注意到 iAds 的填充率非常低,并且希望 AdMob
我们有一个支持 iAds 的应用程序。显然 iPad 版 iOs 4.2 将支持这一点,但是使用 beta SDK 进行一些测试,无法调整横幅大小以使其适合 SplitViewController 的
我在全新的项目中实现了一个非常简单的 iAd 横幅,当我运行它时,我收到错误 ERROR:无法从数据库获取接收器数据! 代码非常基本,所以我认为问题与代码无关,但我会添加它以防万一: #import
我最近更新了我的开发者成员(member)资格。我的新契约(Contract)于 5 月 19 日生效。上周我进去浏览了我的 iAd 收入,发现我所有的 iAd 应用程序都是“红色”并且没有收到广告。
Wirh SDK 4.2 和 iOS5,这让我有些困惑。在我新的基于标签栏的应用程序中,我有多个 View Controller 。我已经仔细检查并重新检查所有 iAd delgate 方法是否存在。
我是一名优秀的程序员,十分优秀!