שגיאות בחירת מודעות

בחירת פלטפורמה: 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/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;
}

המידע הזה יכול לעזור לקבוע בצורה מדויקת יותר מה גרם לטעינת המודעה להיכשל. בפרט, אם מופיעות שגיאות בדומיין com.google.admob ב-iOS או com.google.android.gms.ads ב-Android, אפשר לעיין במאמר הזה במרכז העזרה כדי לקבל הסבר מפורט יותר על GetMessage() ועל הפעולות שאפשר לבצע כדי לפתור את הבעיה.