광고 로드 오류

AdResult 객체는 광고 로드 실패를 감지하는 메커니즘을 제공합니다. 실패하면 AdResult 메서드 is_successful()가 false를 반환합니다. 이러한 상황에서 AdResult 메서드 ad_error()를 호출하면 오류와 관련된 정보와 함께 AdError 객체가 반환됩니다.

다음은 광고 로드에 실패할 때 사용할 수 있는 정보를 보여주는 코드 스니펫입니다.

firebase::Future<firebase::gma::AdResult> load_ad_future =
  ad_view->LoadAd(request);

// In a game loop, monitor the load ad status
if (load_ad_future.status() == firebase::kFutureStatusComplete) {
  const firebase::gma::AdResult* ad_result = load_ad_future.result();
  if (!ad_result.is_successful()) {
    // There was an error loading the ad.
    const AdError& ad_error = ad_result.ad_error();
    firebase::gma::AdErrorCode code = ad_error.code();
    std::string domain = ad_error.domain();
    std::string message = ad_error.message();
    const firebase::gma::ResponseInfo response_info = ad_error.response_info();
    printf("Received error with domain: %s, code: %d, message: %s and response info: %s\n”,
      domain.c_str(), message.c_str(), response_info.ToString().c_str());
  }
}

이 정보를 사용하여 광고 로드에 실패한 원인을 보다 정확하게 파악할 수 있습니다. 특히 iOS의 경우 com.google.admob 도메인, Android의 경우 com.google.android.gms.ads 도메인에 오류가 있는 경우 이 고객센터 도움말에서 메시지를 확인하여 더 자세한 설명과 문제 해결을 위해 취할 수 있는 조치를 확인할 수 있습니다.