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

前端 未结 6 859
情歌与酒
情歌与酒 2021-02-07 13:54

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)
    

提交回复
热议问题