Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
AdResult-Objekte bieten einen Mechanismus zum Erkennen fehlgeschlagener Versuche, eine Anzeige zu laden.
Wenn ein Fehler auftritt, gibt die AdResult-Methode is_successful() „false“ zurück.
In diesen Fällen wird beim Aufrufen der AdResult-Methode ad_error() ein AdError-Objekt mit Informationen zum Fehler zurückgegeben.
Hier sehen Sie ein Code-Snippet, das die Informationen veranschaulicht, die verfügbar sind, wenn eine Anzeige nicht geladen werden kann:
firebase::Future<firebase::gma::AdResult>load_ad_future=ad_view->LoadAd(request);// In a game loop, monitor the load ad statusif(load_ad_future.status()==firebase::kFutureStatusComplete){constfirebase::gma::AdResult*ad_result=load_ad_future.result();if(!ad_result.is_successful()){// There was an error loading the ad.constAdError&ad_error=ad_result.ad_error();firebase::gma::AdErrorCodecode=ad_error.code();std::stringdomain=ad_error.domain();std::stringmessage=ad_error.message();constfirebase::gma::ResponseInforesponse_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());}}
Anhand dieser Informationen lässt sich genauer ermitteln, warum das Laden der Anzeige fehlgeschlagen ist. Insbesondere bei Fehlern unter der Domain com.google.admob auf iOS und com.google.android.gms.ads auf Android kann die Meldung in diesem Hilfeartikel nachgeschlagen werden, um eine detailliertere Erklärung und mögliche Maßnahmen zur Behebung des Problems zu erhalten.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-16 (UTC)."],[[["The Google Mobile Ads C++ SDK is deprecated and will be end-of-maintenance on June 17, 2025, with iOS and Android SDKs recommended as alternatives."],["Developers should use `AdResult` objects, specifically the `is_successful()` and `ad_error()` methods, to detect and diagnose ad loading failures."],["`AdError` objects provide detailed error information, including domain, code, and message, for troubleshooting failed ad loads."],["Error messages can be cross-referenced with the Google AdMob help center to identify the root cause and potential solutions."]]],["The Google Mobile Ads C++ SDK is deprecated as of June 17, 2024, and will reach End-of-Maintenance on June 17, 2025. AdMob iOS and Android SDKs are recommended alternatives. `AdResult` objects detect failed ad loads; `is_successful()` indicates success, and `ad_error()` retrieves an `AdError` object for failures. The `AdError` includes error domain, code, message, and response info, which can be used to troubleshoot. Refer to the Google help center for specific error resolutions.\n"]]