Ошибки загрузки объявлений
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Выберите платформу: Android iOS Unity Flutter Если не загружается реклама, вызывается обратный вызов ошибки, который предоставляет объект LoadAdError
.
Следующий фрагмент кода извлекает информацию об ошибке, если объявление с вознаграждением не загружается:
onAdFailedToLoad: (ad, loadAdError) {
// Gets the domain from which the error came.
String domain = loadAdError.domain;
// Gets the error code. See
// https://developers.google.com/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/AdRequest
// and https://developers.google.com/ad-manager/mobile-ads-sdk/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;
}
Эта информация может быть использована для более точного определения причины сбоя загрузки рекламы. В частности, для ошибок в доменах com.google.admob
на iOS и com.google.android.gms.ads
на Android, более подробное описание GetMessage()
и возможные действия по решению проблемы можно найти в этой статье справочного центра .
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-08-29 UTC.
[null,null,["Последнее обновление: 2025-08-29 UTC."],[[["\u003cp\u003eWhen an ad fails to load, a \u003ccode\u003eLoadAdError\u003c/code\u003e object is provided in the failure callback, containing details about the error.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLoadAdError\u003c/code\u003e object provides information such as the error domain, code, message, and response details for debugging purposes.\u003c/p\u003e\n"],["\u003cp\u003eFor errors originating from Google AdMob (domains \u003ccode\u003ecom.google.admob\u003c/code\u003e or \u003ccode\u003ecom.google.android.gms.ads\u003c/code\u003e), further information and troubleshooting steps can be found in the AdMob help center article linked in the documentation.\u003c/p\u003e\n"]]],["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"],null,["# Ad load errors\n\nSelect platform: [Android](/ad-manager/mobile-ads-sdk/android/ad-load-errors \"View this page for the Android platform docs.\") [iOS](/ad-manager/mobile-ads-sdk/ios/ad-load-errors \"View this page for the iOS platform docs.\") [Unity](/ad-manager/mobile-ads-sdk/unity/ad-load-errors \"View this page for the Unity platform docs.\") [Flutter](/ad-manager/mobile-ads-sdk/flutter/ad-load-errors \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nWhen an ad fails to load, a failure callback is called which provides a\n`LoadAdError` object.\n\nThe following code snippet retrieves error information when a rewarded ad fails\nto load: \n\n onAdFailedToLoad: (ad, loadAdError) {\n // Gets the domain from which the error came.\n String domain = loadAdError.domain;\n\n // Gets the error code. See\n // https://developers.google.com/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/AdRequest\n // and https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Enums/GADErrorCode\n // for a list of possible codes.\n int code = loadAdError.code;\n\n // A log friendly string summarizing the error.\n String message = loadAdError.message;\n\n // Get response information, which may include results of mediation requests.\n ResponseInfo? responseInfo = loadAdError.responseInfo;\n }\n\nThis information can be used to more accurately determine what caused the ad\nload to fail. In particular, for errors under the domain `com.google.admob` on\niOS and `com.google.android.gms.ads` on Android, the `GetMessage()` can be\nlooked up in [this help center\narticle](//support.google.com/admob/answer/9905175) for a more detailed\nexplanation and possible actions that can be taken to resolve the issue."]]