برای مناقصه: Google Mobile Ads SDK 7.53.1 یا بالاتر.
Google Mobile Ads SDK را راهاندازی کنید
راهنمای شروع سریع به شما نشان می دهد که چگونه SDK تبلیغات تلفن همراه Google را مقداردهی اولیه کنید . در طول آن تماس اولیه، آداپتورهای واسطه نیز مقداردهی اولیه می شوند. برای تأیید مشارکت کامل هر شبکه تبلیغاتی در اولین درخواست تبلیغات، مهم است که منتظر بمانید تا مقداردهی اولیه قبل از بارگیری تبلیغات کامل شود.
کد نمونه زیر نشان می دهد که چگونه می توانید وضعیت اولیه سازی هر آداپتور را قبل از درخواست تبلیغ بررسی کنید.
هر کلاس قالب تبلیغاتی دارای یک ویژگی GADResponseInfo است که حاوی adNetworkClassName است که نام کلاس شبکه تبلیغاتی را برای تبلیغ فعلی برمیگرداند. adNetworkClassName فقط زمانی یک مقدار دارد که یک تبلیغ با موفقیت بارگیری شود. کد زیر به شما نشان می دهد که چگونه می توانید این اطلاعات را برای تبلیغات بنری دریافت کنید.
سویفت
funcadViewDidReceiveAd(_bannerView:AdManagerBannerView){print("Banner adapter class name: \(bannerView.responseInfo.adNetworkClassName)")}
هدف-C
-(void)adViewDidReceiveAd:(GAMBannerView*)bannerView{NSLog(@"Banner adapter class name: %@",bannerView.responseInfo.adNetworkClassName);}
مطمئن شوید که Refresh را در همه رابطهای کاربری منبع آگهی شخص ثالث برای واحدهای تبلیغات بنری مورد استفاده در میانجیگری غیرفعال کنید. این کار از یک بهروزرسانی مضاعف جلوگیری میکند، زیرا Ad Manager نیز بر اساس نرخ تازهسازی واحد تبلیغات بنر شما، بهروزرسانی را راهاندازی میکند.
از تبلیغات بومی با واسطه استفاده کنید
در زیر برخی از بهترین شیوه هایی که باید در هنگام اجرای میانجیگری بومی در نظر گرفته شوند آورده شده است.
خط مشی ارائه تبلیغات بومی
هر شبکه تبلیغاتی سیاست های خاص خود را دارد. هنگام استفاده از میانجیگری، مهم است که به یاد داشته باشید که برنامه شما همچنان باید از خطمشیهای شبکه واسطهای که آگهی را ارائه کرده است، تبعیت کند.
هنگام درخواست از کلاس GADMultipleAdsAdLoaderOptions استفاده نکنید
درخواستها برای چندین آگهی بومی فقط تبلیغات Google را ارائه میکنند. ویژگی چندگانه تبلیغات بومی از میانجیگری پشتیبانی نمی کند.
تاریخ آخرین بهروزرسانی 2025-09-06 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-09-06 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThis guide explains how to integrate a mediation adapter with your iOS app to maximize ad revenue by utilizing multiple ad networks.\u003c/p\u003e\n"],["\u003cp\u003eBefore integrating mediation, ensure you've integrated the desired ad formats (banner, interstitial, native, rewarded, rewarded interstitial) into your app.\u003c/p\u003e\n"],["\u003cp\u003eInitialize the Mobile Ads SDK to enable mediation adapters and check each adapter's initialization status before loading ads for optimal performance.\u003c/p\u003e\n"],["\u003cp\u003eIdentify the ad network serving the ad by accessing the \u003ccode\u003eadNetworkClassName\u003c/code\u003e property within the \u003ccode\u003eGADResponseInfo\u003c/code\u003e of the ad format class.\u003c/p\u003e\n"],["\u003cp\u003eFor banner ads used in mediation, disable refresh in third-party ad source UIs to avoid double refreshing, and consider native ad presentation policies and privacy laws when implementing native mediation.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\nThis guide shows you how to integrate a mediation adapter with your\niOS app.\n\nPrerequisites\n\nBefore you can integrate mediation for an ad format, you need to integrate that\nad format into your app:\n\n- [Banner Ads](/ad-manager/mobile-ads-sdk/ios/banner)\n- [Interstitial Ads](/ad-manager/mobile-ads-sdk/ios/interstitial)\n- [Native Ads](/ad-manager/mobile-ads-sdk/ios/native)\n- [Rewarded Ads](/ad-manager/mobile-ads-sdk/ios/rewarded)\n- [Rewarded Interstitial\n Ads](/ad-manager/mobile-ads-sdk/ios/rewarded-interstitial)\n\nNew to mediation? Read\n\n[Introduction to mediation](//support.google.com/admanager/answer/6272813).\n\nFor bidding:\n\nGoogle Mobile Ads SDK 7.53.1\nor higher.\n\nInitialize Google Mobile Ads SDK\n\nThe quick start guide shows you how to [initialize the Google Mobile Ads SDK](/ad-manager/mobile-ads-sdk/ios/quick-start#initialize_the_mobile_ads_sdk).\nDuring that initialization call, mediation adapters also\nget initialized. It is important to wait for initialization to complete before\nyou load ads in order to verify full participation from every ad network on the\nfirst ad request.\n| **Important:** Bidding adapters require you to explicitly initialize Google Mobile Ads SDK.\n\nThe following sample code shows how you can check each adapter's initialization\nstatus prior to making an ad request. \n\nSwift \n\n import GoogleMobileAds\n\n @UIApplicationMain\n class AppDelegate: UIResponder, UIApplicationDelegate {\n\n func application(_ application: UIApplication,\n didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n\n MobileAds.shared.start { status in\n // Optional: Log each adapter's initialization latency.\n let adapterStatuses = status.adapterStatusesByClassName\n for adapter in adapterStatuses {\n let adapterStatus = adapter.value\n NSLog(\"Adapter Name: %@, Description: %@, Latency: %f\", adapter.key,\n adapterStatus.description, adapterStatus.latency)\n }\n // Start loading ads here...\n }\n\n return true\n }\n\n }\n\nObjective-C \n\n @import GoogleMobileAds;\n\n @implementation AppDelegate\n\n - (BOOL)application:(UIApplication *)application\n didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n\n GADMobileAds \\*ads = \\[GADMobileAds sharedInstance\\];\n \\[ads startWithCompletionHandler:\\^(GADInitializationStatus \\*status) {\n // Optional: Log each adapter's initialization latency.\n NSDictionary \\*adapterStatuses = \\[status adapterStatusesByClassName\\];\n for (NSString \\*adapter in adapterStatuses) {\n GADAdapterStatus \\*adapterStatus = adapterStatuses\\[adapter\\];\n NSLog(@\"Adapter Name: %@, Description: %@, Latency: %f\", adapter,\n adapterStatus.description, adapterStatus.latency);\n }\n // Start loading ads here...\n }\\];\n return YES;\n }\n\n @end\n\nKnow which ad network wins\n\nEach ad format class has a `GADResponseInfo` property that contains\n`adNetworkClassName` which returns the class name of the ad network for the\ncurrent ad. `adNetworkClassName` only has a value once an ad successfully\nloads. The following code shows you how to get that information for banner ads. \n\nSwift \n\n func adViewDidReceiveAd(_ bannerView: AdManagerBannerView) {\n print(\"Banner adapter class name: \\(bannerView.responseInfo.adNetworkClassName)\")\n }\n\nObjective-C \n\n - (void)adViewDidReceiveAd:(GAMBannerView *)bannerView {\n NSLog(@\"Banner adapter class name: %@\", bannerView.responseInfo.adNetworkClassName);\n }\n\nRefer to [Retrieving Information about the Ad Response](/ad-manager/mobile-ads-sdk/ios/response-info)\nfor details.\n\n\u003cbr /\u003e\n\nUse banner ads with mediation\n\nMake sure to disable refresh in all third-party ad source UIs for banner ad\nunits used in mediation. This prevents a\ndouble refresh since Ad Manager also triggers a refresh\nbased on your banner ad unit's refresh rate.\n\nUse native ads with mediation\n\nThe following are some best practices to consider when implementing native\nmediation.\n\nNative ad presentation policy\n: Each ad network has its own policies. When using mediation, it's important to\n remember that your app still needs to abide by the policies of the mediated\n network that provided the ad.\n\nAvoid using the `GADMultipleAdsAdLoaderOptions` class when making requests\n: Requests for multiple native ads only serve Google ads. The multiple native\n ads feature does not support mediation.\n\nUS states privacy laws and GDPR\n\nIf you need to comply with the [U.S. states privacy\nlaws](//support.google.com/admanager/answer/9561023) or [General Data Protection\nRegulation (GDPR)](//support.google.com/admanager/answer/7666366), follow the\nsteps in [US state regulations\nsettings](//support.google.com/admanager/answer/10115735) or [GDPR\nsettings](//support.google.com/admanager/answer/10113006#adding_ad_partners_to_published_gdpr_messages) to add your\nmediation partners in Ad Manager Privacy \\& messaging's\nUS states or GDPR ad partners list. Failure to do so can lead to partners\nfailing to serve ads on your app.\n\nLearn more about enabling [restricted data processing\n(RDP)](/ad-manager/mobile-ads-sdk/ios/privacy/us-states) and obtaining GDPR consent with the\n[Google User Messaging Platform (UMP) SDK](/ad-manager/mobile-ads-sdk/ios/privacy)."]]