Errori di caricamento degli annunci
Quando un annuncio non viene caricato, viene chiamato un callback di errore che fornisce una
LoadAdError
oggetto.
Lo snippet di codice riportato di seguito recupera le informazioni sull'errore quando un annuncio con premio non funziona
per caricare:
onAdFailedToLoad: (ad, loadAdError) {
// Gets the domain from which the error came.
String domain = loadAdError.domain;
// Gets the error code. See
// https://developers.google.com/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;
}
Queste informazioni possono essere utilizzate per determinare con maggiore precisione la causa dell'annuncio
il caricamento non riesce. In particolare, per gli errori nel dominio com.google.admob
su
iOS e com.google.android.gms.ads
su Android, GetMessage()
può essere
cercato in questo Centro assistenza
per informazioni più dettagliate
la spiegazione e le possibili azioni che è possibile intraprendere per risolvere il problema.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-08-29 UTC.
[null,null,["Ultimo aggiornamento 2024-08-29 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"]]