Błędy wczytywania reklam
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Gdy nie uda się wczytać reklamy, wywoływane jest wywołanie zwrotne o niepowodzeniu, które przekazuje
LoadAdError
obiekt.
Ten fragment kodu pobiera informacje o błędzie w przypadku niepowodzenia reklamy z nagrodą
w celu załadowania:
onAdFailedToLoad: (ad, loadAdError) {
// Gets the domain from which the error came.
String domain = loadAdError.domain;
// Gets the error code. See
// https://developers.google.com/admob/android/reference/com/google/android/gms/ads/AdRequest
// and https://developers.google.com/admob/ios/api/reference/Enums/GADErrorCode
// for a list of possible codes.
int code = loadAdError.code;
// A log friendly string summarizing the error.
String message = loadAdError.message;
// Get response information, which may include results of mediation requests.
ResponseInfo? responseInfo = loadAdError.responseInfo;
}
Za pomocą tych informacji można dokładniej określić, co spowodowało wyświetlenie reklamy
nie udało się wczytać. W szczególności w przypadku błędów w domenie com.google.admob
w iOS i com.google.android.gms.ads
na Androidzie, GetMessage()
może być
wyszukano w tym Centrum pomocy
artykule, gdzie znajdziesz bardziej szczegółowe informacje.
wyjaśnienie i możliwe działania, które można podjąć w celu rozwiązania problemu.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-03-15 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-03-15 UTC."],[[["When an ad fails to load, a `LoadAdError` object provides detailed information about the failure through its properties."],["Developers can access error domain, code, message, and response info from the `LoadAdError` object to understand the reason for ad load failure."],["For errors originating from Google AdMob (specific domains on iOS and Android), the error message can be cross-referenced with a help center article for troubleshooting and resolution guidance."]]],["When an ad fails to load, a `LoadAdError` object is provided via a callback. This object contains error details, including the error's domain, a specific error code, a summarized message, and response information that could be related to mediation. For errors originating from `com.google.admob` (iOS) or `com.google.android.gms.ads` (Android), the message can be checked in a help center article for in-depth information and potential solutions. This information helps to pinpoint the cause of ad loading failure.\n"]]