Quando il caricamento di un annuncio non riesce, viene chiamato un callback di errore che fornisce un oggetto
LoadAdError.
Il seguente snippet di codice recupera le informazioni sugli errori quando il caricamento di un annuncio con premio non va a buon fine:
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;}
Queste informazioni possono essere utilizzate per determinare con maggiore precisione la causa del mancato caricamento dell'annuncio. In particolare, per gli errori nel dominio com.google.admob su
iOS e com.google.android.gms.ads su Android, il GetMessage() può essere
consultato in questo articolo del Centro assistenza per una spiegazione più dettagliata e le possibili azioni da intraprendere per risolvere il problema.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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"]]