Gdy nie uda się wczytać reklamy, wywoływana jest funkcja zwrotna informująca o niepowodzeniu, która udostępnia obiekt LoadAdError.
Ten fragment kodu pobiera informacje o błędach, gdy nie uda się wczytać reklamy z nagrodą:
onAdFailedToLoad:(ad,loadAdError){// Gets the domain from which the error came.Stringdomain=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.intcode=loadAdError.code;// A log friendly string summarizing the error.Stringmessage=loadAdError.message;// Get response information, which may include results of mediation requests.ResponseInfo?responseInfo=loadAdError.responseInfo;}
Te informacje mogą pomóc w dokładniejszym określeniu przyczyny niepowodzenia wczytania reklamy. W szczególności w przypadku błędów w domenie com.google.admob w
iOS i com.google.android.gms.ads w Androidzie można wyszukać GetMessage() w tym artykule w Centrum pomocy, aby uzyskać bardziej szczegółowe
wyjaśnienie i możliwe działania, które można podjąć w celu rozwiązania problemu.
[[["Ł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: 2026-07-08 UTC."],[],["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"]]