gpt4 book ai didi

ios - 要在此设备上获取测试广告,请调用 : request. testDevices = [NSArray arrayWithObjects :GAD_SIMULATOR_ID, nil];

转载 作者:技术小花猫 更新时间:2023-10-29 10:31:12 25 4
gpt4 key购买 nike

当我在模拟器中测试 Admob 时,它会抛出以下错误

To get test ads on this device, call: request.testDevices = [NSArray arrayWithObjects:GAD_SIMULATOR_ID, nil];

我的代码

bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
bannerView_.adUnitID = @"8de66ecc3525495d";

bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];

GADRequest *request = [[GADRequest alloc] init];
request.testing = YES;
[bannerView_ loadRequest:request];

指导我存档。提前致谢..

最佳答案

您必须添加测试设备。使用 Swift,只需替换

bannerView.load(GADRequest())

let request: GADRequest = GADRequest()
request.testDevices = [kGADSimulatorID]
bannerView.load(request)

如果您有 iPhone,也可以运行该应用程序,它会告诉您 ID。

要在此设备上获取测试广告,请调用:request.testDevices = @[@"HERE IS THE ID"];

添加的ID:

let request: GADRequest = GADRequest()
request.testDevices = ["PUT HERE THE ID", kGADSimulatorID]
bannerView.load(request)

关于ios - 要在此设备上获取测试广告,请调用 : request. testDevices = [NSArray arrayWithObjects :GAD_SIMULATOR_ID, nil];,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19527478/

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