विज्ञापन लोड करने से जुड़ी गड़बड़ियां
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
प्लैटफ़ॉर्म चुनें:
Android
iOS
Unity
Flutter
जब कोई विज्ञापन लोड नहीं होता है, तो डेलिगेट तरीके या कंप्लीशन हैंडलर को कॉल किया जाता है. इससे NSError
ऑब्जेक्ट मिलता है.
GADBannerView
के लिए, इसे इस तरह से कहा जाता है:
विज्ञापन लोड न होने पर उपलब्ध जानकारी का उदाहरण यहां दिया गया है:
Swift
func bannerView(_ bannerView: BannerView, didFailToReceiveAdWithError error: Error) {
// Gets the domain from which the error came.
let errorDomain = error.domain
// Gets the error code. See
// https://developers.google.com/admob/ios/api/reference/Enums/GADErrorCode
// for a list of possible codes.
let errorCode = error.code
// Gets an error message.
// For example "Account not approved yet". See
// https://support.google.com/admob/answer/9905175 for explanations of
// common errors.
let errorMessage = error.localizedDescription
// Gets additional response information about the request. See
// https://developers.google.com/admob/ios/response-info for more information.
let responseInfo = (error as NSError).userInfo[GADErrorUserInfoKeyResponseInfo] as? ResponseInfo
// Gets the underlyingError, if available.
let underlyingError = (error as NSError).userInfo[NSUnderlyingErrorKey] as? Error
if let responseInfo = responseInfo {
print("Received error with domain: \(errorDomain), code: \(errorCode),"
+ "message: \(errorMessage), responseInfo: \(responseInfo),"
+ "underlyingError: \(underlyingError?.localizedDescription ?? "nil")")
}
}
Objective-C
- (void)bannerView:(GADBannerView *)bannerView
didFailToReceiveAdWithError:(NSError *)error {
// Gets the domain from which the error came.
NSString *errorDomain = error.domain;
// Gets the error code. See
// https://developers.google.com/admob/ios/api/reference/Enums/GADErrorCode
// for a list of possible codes.
int errorCode = error.code;
// Gets an error message.
// For example "Account not approved yet". See
// https://support.google.com/admob/answer/9905175 for explanations of
// common errors.
NSString *errorMessage = error.localizedDescription;
// Gets additional response information about the request. See
// https://developers.google.com/admob/ios/response-info for more
// information.
GADResponseInfo *responseInfo = error.userInfo[GADErrorUserInfoKeyResponseInfo];
// Gets the underlyingError, if available.
NSError *underlyingError = error.userInfo[NSUnderlyingErrorKey];
NSLog(@"Received error with domain: %@, code: %ld, message: %@, "
@"responseInfo: %@, underlyingError: %@",
errorDomain, errorCode, errorMessage, responseInfo,
underlyingError.localizedDescription);
}
डोमेन
GADErrorDomain
से जुड़ी गड़बड़ियों के लिए,
localizedDescription
को
शामिल होने से जुड़ी आम समस्याओं को हल करना लेख में देखा जा सकता है. इसमें गड़बड़ी के बारे में ज़्यादा जानकारी दी गई है. साथ ही, समस्या को हल करने के लिए की जा सकने वाली कार्रवाइयों के बारे में बताया गया है.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-25 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eWhen an ad fails to load, a delegate method or completion handler is called, providing an \u003ccode\u003eNSError\u003c/code\u003e object with details about the failure.\u003c/p\u003e\n"],["\u003cp\u003eFor \u003ccode\u003eGADBannerView\u003c/code\u003e, the \u003ccode\u003ebannerView(_:didFailToReceiveAdWithError:)\u003c/code\u003e method is called when an ad fails to load.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eNSError\u003c/code\u003e object contains information like error domain, code, message, response info, and underlying error, which can be used for debugging.\u003c/p\u003e\n"],["\u003cp\u003eFor errors in the \u003ccode\u003eGADErrorDomain\u003c/code\u003e, the \u003ccode\u003elocalizedDescription\u003c/code\u003e can be cross-referenced with the AdMob help center article (linked in the content) for troubleshooting.\u003c/p\u003e\n"]]],["When an ad fails to load, a delegate method or completion handler provides an `NSError` object. This object reveals the error's domain, code, and a descriptive message. It also includes optional response information and an underlying error. The `GADBannerView`'s `bannerView:didFailToReceiveAdWithError:` method is triggered upon failure. Developers can access and log details from the error object to understand and potentially resolve the ad loading issue, consulting additional resources for further information on error codes.\n"],null,["Select platform: [Android](/admob/android/ad-load-errors \"View this page for the Android platform docs.\") [iOS](/admob/ios/ad-load-errors \"View this page for the iOS platform docs.\") [Unity](/admob/unity/ad-load-errors \"View this page for the Unity platform docs.\") [Flutter](/admob/flutter/ad-load-errors \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nIn cases where an ad fails to load, a\ndelegate method or completion handler\nis called which provides a `NSError` object.\n\nFor `GADBannerView`, the following is called: \n\nSwift \n\n func bannerView(_ bannerView: BannerView, /admob/ios/api/reference/Protocols/GADBannerViewDelegate#-adview:didfailtoreceiveadwitherror: error: Error)\n\nObjective-C \n\n - (void)bannerView:(nonnull GADBannerView *)bannerView\n /admob/ios/api/reference/Protocols/GADBannerViewDelegate#-adview:didfailtoreceiveadwitherror:error;\n\nThe following example shows the information available when an ad fails to load: \n\nSwift \n\n func bannerView(_ bannerView: BannerView, didFailToReceiveAdWithError error: Error) {\n // Gets the domain from which the error came.\n let errorDomain = error.domain\n // Gets the error code. See\n // https://developers.google.com/admob/ios/api/reference/Enums/GADErrorCode\n // for a list of possible codes.\n let errorCode = error.code\n // Gets an error message.\n // For example \"Account not approved yet\". See\n // https://support.google.com/admob/answer/9905175 for explanations of\n // common errors.\n let errorMessage = error.localizedDescription\n // Gets additional response information about the request. See\n // https://developers.google.com/admob/ios/response-info for more information.\n let responseInfo = (error as NSError).userInfo[GADErrorUserInfoKeyResponseInfo] as? ResponseInfo\n // Gets the underlyingError, if available.\n let underlyingError = (error as NSError).userInfo[NSUnderlyingErrorKey] as? Error\n if let responseInfo = responseInfo {\n print(\"Received error with domain: \\(errorDomain), code: \\(errorCode),\"\n + \"message: \\(errorMessage), responseInfo: \\(responseInfo),\"\n + \"underlyingError: \\(underlyingError?.localizedDescription ?? \"nil\")\")\n }\n }\n\nObjective-C \n\n - (void)bannerView:(GADBannerView *)bannerView\n didFailToReceiveAdWithError:(NSError *)error {\n // Gets the domain from which the error came.\n NSString *errorDomain = error.domain;\n // Gets the error code. See\n // https://developers.google.com/admob/ios/api/reference/Enums/GADErrorCode\n // for a list of possible codes.\n int errorCode = error.code;\n // Gets an error message.\n // For example \"Account not approved yet\". See\n // https://support.google.com/admob/answer/9905175 for explanations of\n // common errors.\n NSString *errorMessage = error.localizedDescription;\n // Gets additional response information about the request. See\n // https://developers.google.com/admob/ios/response-info for more\n // information.\n GADResponseInfo *responseInfo = error.userInfo[GADErrorUserInfoKeyResponseInfo];\n // Gets the underlyingError, if available.\n NSError *underlyingError = error.userInfo[NSUnderlyingErrorKey];\n NSLog(@\"Received error with domain: %@, code: %ld, message: %@, \"\n @\"responseInfo: %@, underlyingError: %@\",\n errorDomain, errorCode, errorMessage, responseInfo,\n underlyingError.localizedDescription);\n }\n\nFor errors under the domain `GADErrorDomain`, the `localizedDescription` can be looked up in the [Resolve common onboarding issues article](//support.google.com/admob/answer/9905175) for a more detailed explanation and possible actions that can be taken to resolve the issue."]]