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

前端 未结 6 766
情歌与酒
情歌与酒 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

    I used to do this:

    GADRequest *request = [GADRequest request];
    
    // Make the request for a test ad. Put in an identifier for
    // the simulator as well as any devices you want to receive test ads.
    request.testDevices = [NSArray arrayWithObjects:GAD_SIMULATOR_ID, nil];
    [gAdBannerView loadRequest:request];
    

    where I define

    // Constant for getting test ads on the simulator using the testDevices method.
    #define GAD_SIMULATOR_ID @"Simulator"
    

提交回复
热议问题