خطاهای بارگذاری آگهی
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
هنگامی که تبلیغی بارگیری نمیشود، یک بازخوانی شکست نامیده میشود که یک شی LoadAdError
را ارائه میکند.
قطعه کد زیر اطلاعات خطا را زمانی که آگهی بارگیری نمی شود بازیابی می کند:
public void OnAdFailedToLoad(LoadAdError error)
{
// Gets the domain from which the error came.
string domain = error.GetDomain();
// 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 = error.GetCode();
// Gets an error message.
// For example "Account not approved yet". See
// https://support.google.com/admob/answer/9905175 for explanations of
// common errors.
string message = error.GetMessage();
// Gets the cause of the error, if available.
AdError underlyingError = error.GetCause();
// All of this information is available via the error's toString() method.
Debug.Log("Load error string: " + error.ToString());
// Get response information, which may include results of mediation requests.
ResponseInfo responseInfo = error.GetResponseInfo();
Debug.Log("Response info: " + responseInfo.ToString());
}
از این اطلاعات می توان برای تعیین دقیق تری استفاده کرد که چه چیزی باعث شکست بارگذاری تبلیغات شده است. به ویژه، برای خطاهای زیر دامنه com.google.admob
در iOS و com.google.android.gms.ads
در Android، GetMessage()
می توان در این مقاله مرکز راهنمایی برای توضیح دقیق تر و اقدامات احتمالی جستجو کرد. می توان برای حل این موضوع اقدام کرد.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-03-14 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-03-14 بهوقت ساعت هماهنگ جهانی."],[[["When an ad fails to load, a `LoadAdError` object is provided in a failure callback, containing information about the error."],["The `LoadAdError` object provides access to the error domain, code, message, underlying cause, and response information."],["Developers can use the error code and message, especially for errors from `com.google.admob` or `com.google.android.gms.ads`, to diagnose and resolve ad loading issues with help from the provided resources."],["The `LoadAdError` object's `ToString()` method and `GetResponseInfo().ToString()` method offer comprehensive overviews of the error and response details for debugging."]]],["When an ad fails to load, the `LoadAdError` object provides details via a callback. Key actions include retrieving the error's domain using `GetDomain()`, the error code with `GetCode()`, and a descriptive message via `GetMessage()`. The underlying cause is accessible with `GetCause()`. All data is also in the `ToString()` method. `GetResponseInfo()` offers insights, possibly regarding mediation. `GetMessage()` can be researched in a specific article to resolve the cause of the ad loading failure.\n"]]