AdResult অবজেক্ট একটি বিজ্ঞাপন লোড করার ব্যর্থ প্রচেষ্টা সনাক্ত করার জন্য একটি প্রক্রিয়া প্রদান করে। যদি একটি ব্যর্থতা ঘটে, AdResult পদ্ধতি is_successful() মিথ্যা ফেরত দেবে। এই পরিস্থিতিতে, AdResult পদ্ধতি ad_error() ব্যবহার করলে ত্রুটি সংক্রান্ত তথ্য সহ একটি AdError অবজেক্ট ফিরে আসবে।
এখানে একটি কোড স্নিপেট রয়েছে যা একটি বিজ্ঞাপন লোড হতে ব্যর্থ হলে উপলব্ধ তথ্য তুলে ধরে:
firebase::Future<firebase::gma::AdResult>load_ad_future=ad_view->LoadAd(request);// In a game loop, monitor the load ad statusif(load_ad_future.status()==firebase::kFutureStatusComplete){constfirebase::gma::AdResult*ad_result=load_ad_future.result();if(!ad_result.is_successful()){// There was an error loading the ad.constAdError&ad_error=ad_result.ad_error();firebase::gma::AdErrorCodecode=ad_error.code();std::stringdomain=ad_error.domain();std::stringmessage=ad_error.message();constfirebase::gma::ResponseInforesponse_info=ad_error.response_info();printf("Received error with domain: %s, code: %d, message: %s and response info: %s\n”,domain.c_str(),message.c_str(),response_info.ToString().c_str());}}
বিজ্ঞাপন লোড ব্যর্থ হওয়ার কারণ কী তা নির্ধারণ করতে এই তথ্যটি আরও সঠিকভাবে ব্যবহার করা যেতে পারে। বিশেষ করে, iOS-এ com.google.admob এবং Android-এ com.google.android.gms.ads ডোমেনের অধীনে ত্রুটির জন্য, সমস্যাটির সমাধান করার জন্য আরও বিশদ ব্যাখ্যা এবং সম্ভাব্য পদক্ষেপের জন্য বার্তাটি এই সহায়তা কেন্দ্র নিবন্ধে দেখা যেতে পারে।
[null,null,["2025-02-23 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["The Google Mobile Ads C++ SDK is deprecated and will be end-of-maintenance on June 17, 2025, with iOS and Android SDKs recommended as alternatives."],["Developers should use `AdResult` objects, specifically the `is_successful()` and `ad_error()` methods, to detect and diagnose ad loading failures."],["`AdError` objects provide detailed error information, including domain, code, and message, for troubleshooting failed ad loads."],["Error messages can be cross-referenced with the Google AdMob help center to identify the root cause and potential solutions."]]],["The Google Mobile Ads C++ SDK is deprecated as of June 17, 2024, and will reach End-of-Maintenance on June 17, 2025. AdMob iOS and Android SDKs are recommended alternatives. `AdResult` objects detect failed ad loads; `is_successful()` indicates success, and `ad_error()` retrieves an `AdError` object for failures. The `AdError` includes error domain, code, message, and response info, which can be used to troubleshoot. Refer to the Google help center for specific error resolutions.\n"]]