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

前端 未结 6 1249
走了就别回头了
走了就别回头了 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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-07 13:57

    This works for me:

    (GADRequest *)request {
      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 = @[
        // TODO: Add your device/simulator test identifiers here. Your device identifier is printed to
        // the console when the app is launched.
        GAD_SIMULATOR_ID
      ];
      return request;//thanks
    }  
    

提交回复
热议问题