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

前端 未结 6 1252
走了就别回头了
走了就别回头了 2021-02-07 13:16

While i test Admob in simulator, it throws below error

To get test ads on this device, call: request.testDevices = [NSArray arrayWithObjects:GAD_SIMULATO

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-07 14:02

    You have to add your test devices. With Swift, just replace

    bannerView.load(GADRequest())
    

    with

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

    If you have an iPhone, then run the application too and it will tell you the ID.

    To get test ads on this device, call: request.testDevices = @[@"HERE IS THE ID"];

    ID added:

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

提交回复
热议问题