【问题标题】:Cannot present an interestitial ad while testing?测试时无法展示插页式广告?
【发布时间】:2015-05-03 23:29:31
【问题描述】:

当我尝试测试 AdMob 的插页式广告时,没有显示广告。

我使用了来自 Google 的 AdMob 教程网页的代码。 我是否必须添加一个按钮才能执行该操作?

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.interstitial = [[GADInterstitial alloc] init];
    self.interstitial.adUnitID = @"AdMob_Publisher_ID";

    GADRequest *request = [GADRequest request];
    request.testDevices = @[@"2077ef9a63d2b398840261c8221a0c9a"];// divice test number
    [self.interstitial loadRequest:request];

}

【问题讨论】:

    标签: ios admob interstitial


    【解决方案1】:

    你在正确的轨道上。到目前为止,您已经创建了插页式广告,并已向 AdMob 请求了一个测试插页式广告。您接下来需要做的是展示插页式广告。要展示插页式广告,您只需致电[interstitial presentFromRootViewController:self]。用户关闭此插页式广告后,您可以在下次希望再次展示插页式广告时向 AdMob 请求另一个插页式广告。 AdMob 有一个 sample project and tutorial 可用,向您展示如何处理此委托方法和其他委托方法。

    【讨论】:

    • 感谢丹尼尔的回答,你是对的,在代码创建一个简单的按钮来执行指令之后 - (IBAction) adbutton: (id) sender { [self.interstitial presentFromRootViewController: self];插页式广告出现了,但是当我关闭它并再次按下按钮时不再出现。我猜菜鸟的错误,对不起,请帮帮我?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多