Интегрируйте Tencent GDT с медиацией
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Это руководство предназначено для издателей, заинтересованных в использовании медиации Google Mobile Ads с Tencent GDT . В нём подробно описывается настройка адаптера медиации для работы с вашим текущим приложением iOS и настройка дополнительных параметров.
Предпосылки
Полезные учебники
В следующих статьях Справочного центра представлена справочная информация о посредничестве:
Добавьте Tencent GDT в свой проект
Интегрируйте рекламу в своё приложение так же, как и раньше. Чтобы интегрировать не-межстраничную рекламу (размер баннера, размер полноразмерной доски и т. д.), см. раздел «Баннерная реклама» . Чтобы интегрировать межстраничную рекламу (полноэкранную рекламу, которая закрывает весь остальной контент), см. раздел «Межстраничная реклама» .
Следующие шаги преобразуют ваше место размещения рекламы в место размещения медиации, где можно показывать рекламу из нескольких сетей.
Загрузите адаптер и SDK для Tencent GDT из указанных выше ресурсов .
Добавьте загруженный сетевой адаптер/SDK в Xcode: щелкните правой кнопкой мыши по вашему проекту и выберите Добавить файлы в project .
Включите все фреймворки, флаги компилятора или линкера, требуемые Tencent GDT. Дополнительный код писать не нужно. Медиация вызывает адаптер Tencent GDT и SDK по мере необходимости для создания рекламы.
Настроить уведомление о событии
Чтобы получать уведомления о событиях жизненного цикла рекламы, таких как показы, можно реализовать GADBannerViewDelegate
. При использовании медиации этот делегат автоматически уведомляется о событиях от Tencent GDT. Например, показы из любой рекламной сети передаются через метод adViewDidReceiveAd:
объекта GADBannerViewDelegate
.
Проверьте значение adNetworkClassName
При желании вы можете проверить свойство adNetworkClassName
в GADBannerView
, которое возвращает имя класса рекламной сети, которая получила текущий баннер после вызова обратного вызова adViewDidReceiveAd
:
Быстрый
func adViewDidReceiveAd(_ bannerView: GADBannerView) {
print("Banner adapter class name: \(bannerView.adNetworkClassName)")
}
Objective-C
- (void)adViewDidReceiveAd:(GADBannerView *)bannerView {
NSLog(@"Banner adapter class name: %@", bannerView.adNetworkClassName);
}
Аналогично для полноэкранных объявлений проверьте свойство adNetworkClassName
в GADInterstitialAd
внутри interstitialDidReceiveAd
:
Быстрый
func interstitialDidReceiveAd(_ ad: GADInterstitialAd) {
print("Interstitial adapter class name: \(ad.adNetworkClassName)")
}
Objective-C
- (void)interstitialDidReceiveAd:(GADInterstitialAd *)interstitial {
NSLog(@"Interstitial adapter class name: %@", interstitial.adNetworkClassName);
}
Для объявлений, возвращаемых AdMob,
adNetworkClassName
возвращает
GADMAdapterGoogleAdMobAds
. Для объявлений, полученных через
пользовательские события , возвращается
GADMAdapterCustomEvents
.
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-09-04 UTC.
[[["Прост для понимания","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-04 UTC."],[[["\u003cp\u003eThis guide helps publishers integrate Tencent YLH with Google Mobile Ads mediation in their iOS apps.\u003c/p\u003e\n"],["\u003cp\u003eIt provides steps for setting up the mediation adapter and configuring necessary settings.\u003c/p\u003e\n"],["\u003cp\u003ePublishers should have an existing iOS app with Google Mobile Ads SDK and an AdMob account with configured ad units.\u003c/p\u003e\n"],["\u003cp\u003eEvent notifications, such as impressions, are automatically handled through the GADBannerViewDelegate or GADInterstitialDelegate.\u003c/p\u003e\n"],["\u003cp\u003eYou can identify the ad network that served the ad by checking the adNetworkClassName property.\u003c/p\u003e\n"]]],["Publishers integrating Tencent GDT with Google Mobile Ads mediation must download the Tencent GDT adapter and SDK. After downloading, add these files to the iOS project in Xcode, including any required frameworks or flags. Ad placement will then use mediation to display ads from multiple networks. Implement `GADBannerViewDelegate` to receive ad lifecycle event notifications and check `adNetworkClassName` to identify the serving ad network. This setup does not require additional code, as mediation invokes the Tencent GDT adapter.\n"],null,["This guide is intended for publishers who are interested in using Google\nMobile Ads mediation with **Tencent GDT**. It walks\nthrough the setup of a mediation adapter to work with your current iOS app\nand the configuration of additional settings.\n\n| Tencent GDT Resources |\n|----------------------------------------------------------------------------------------------|\n| [Documentation](http://e.qq.com/dev/#index) |\n| [SDK](http://imgcache.qq.com/qzone/biz/gdt/dev/sdk/ios/release/GDT_iOS_SDK.zip) |\n| [Adapter](http://imgcache.qq.com/qzone/biz/gdt/dev/sdk/ios/release/GDT_iOS_AdMobAdapter.zip) |\n| [Customer support](mailto:GDTLM@tencent.com) |\n\nPrerequisites\n\n- An iOS app with Google Mobile Ads SDK integrated (If you don't\n have one, see [Get Started](/admob/ios/quick-start).)\n\n- An AdMob account and [an ad unit configured with mediation line\n items](//support.google.com/admob/answer/3124703).\n\nHelpful primers\n\nThe following Help Center articles provide background information on mediation:\n\n- [About AdMob Mediation](//support.google.com/admob/answer/3063564)\n- [Set up AdMob Mediation](//support.google.com/admob/answer/3124703)\n- [Optimize AdMob Network](//support.google.com/admob/answer/3534471)\n\nAdd Tencent GDT to your project\n\nIntegrate ads into your app the same as before. To integrate\nnon-interstitial ads (banner size, leaderboard size, and so on),\nsee [Banner Ads](/admob/ios/banner). To integrate\ninterstitial ads (full-screen ads that mask all other content),\nsee [Interstitial Ads](/admob/ios/interstitial).\n\nThe following steps change your ad placement into a mediation\nplacement that can show ads from multiple networks.\n\n1. Download the adapter and SDK for Tencent GDT from the\n [resources above](#resources).\n\n2. Add the downloaded network adapter/SDK in Xcode: right-click\n on your project and click **Add Files to \u003cvar class=\"readonly\" translate=\"no\"\u003eproject\u003c/var\u003e**.\n\n3. Include any frameworks, compiler flags, or linker flags that Tencent GDT\n require. There's no need to write additional code. Mediation invokes the\n Tencent GDT adapter and SDK as necessary to create ads.\n\nSet up event notification\n\nTo be notified of ad lifecycle events like impressions, you can implement\na `GADBannerViewDelegate`. When using mediation, this delegate is\nautomatically notified of events from Tencent GDT. For example, impressions\nfrom any ad network are reported through the `adViewDidReceiveAd:` method of\n`GADBannerViewDelegate`.\n\nCheck the value of adNetworkClassName\n\nYou can optionally check the `adNetworkClassName` property on\n`GADBannerView`, which returns the ad network class\nname of the ad network that fetched the current banner once the\n`adViewDidReceiveAd` callback is called: \n\nSwift \n\n func adViewDidReceiveAd(_ bannerView: GADBannerView) {\n print(\"Banner adapter class name: \\(bannerView.adNetworkClassName)\")\n }\n\nObjective-C \n\n - (void)adViewDidReceiveAd:(GADBannerView *)bannerView {\n NSLog(@\"Banner adapter class name: %@\", bannerView.adNetworkClassName);\n }\n\nSimilarly, for interstitials, check the `adNetworkClassName` property\non `GADInterstitialAd` inside `interstitialDidReceiveAd`: \n\nSwift \n\n func interstitialDidReceiveAd(_ ad: GADInterstitialAd) {\n print(\"Interstitial adapter class name: \\(ad.adNetworkClassName)\")\n }\n\nObjective-C \n\n - (void)interstitialDidReceiveAd:(GADInterstitialAd *)interstitial {\n NSLog(@\"Interstitial adapter class name: %@\", interstitial.adNetworkClassName);\n }\n\nFor ads returned from AdMob, `adNetworkClassName` returns `GADMAdapterGoogleAdMobAds`. For ads fetched through [custom events](/admob/ios/custom-events), it returns `GADMAdapterCustomEvents`.\n\n\u003cbr /\u003e"]]