This guide is intended for publishers who are interested in using Google Mobile Ads mediation with Vpon . It walks through the setup of a mediation adapter to work with your current iOS app and the configuration of additional settings.
| منابع ویپیان |
|---|
| مستندات |
| SDK |
| آداپتور |
| پشتیبانی مشتری |
پیشنیازها
یک اپلیکیشن iOS با Google Mobile Ads SDK (اگر ندارید، به بخش شروع به کار مراجعه کنید.)
یک حساب Google Ad Manager که Mediation برای برنامههای تلفن همراه در آن پیکربندی شده باشد.
Vpon را به پروژه خود اضافه کنید
Integrate ads into your app the same as before. To integrate non-interstitial ads (banner size, leaderboard size, and so on), see Banner Ads . To integrate interstitial ads (full-screen ads that mask all other content), see Interstitial Ads .
مراحل زیر، جایگاه تبلیغ شما را به یک جایگاه واسطهای تبدیل میکند که میتواند تبلیغات را از چندین شبکه نشان دهد.
آداپتور و SDK مربوط به Vpon را از منابع بالا دانلود کنید.
آداپتور/SDK شبکه دانلود شده را در Xcode اضافه کنید: روی پروژه خود کلیک راست کرده و روی «افزودن فایلها به project کلیک کنید.
هرگونه چارچوب، پرچم کامپایلر یا پرچم لینکر مورد نیاز Vpon را وارد کنید. نیازی به نوشتن کد اضافی نیست. Mediation در صورت لزوم، آداپتور Vpon و SDK را برای ایجاد تبلیغات فراخوانی میکند.
تنظیم اعلان رویداد
To be notified of ad lifecycle events like impressions, you can implement a GADBannerViewDelegate . When using mediation, this delegate is automatically notified of events from Vpon. For example, impressions from any ad network are reported through the adViewDidReceiveAd: method of GADBannerViewDelegate .
مقدار adNetworkClassName را بررسی کنید
You can optionally check the adNetworkClassName property on GAMBannerView , which returns the ad network class name of the ad network that fetched the current banner once the adViewDidReceiveAd callback is called:
سویفت
func adViewDidReceiveAd(_ bannerView: GAMBannerView) {
print("Banner adapter class name: \(bannerView.adNetworkClassName)")
}
هدف-سی
- (void)adViewDidReceiveAd:(GAMBannerView *)bannerView {
NSLog(@"Banner adapter class name: %@", bannerView.adNetworkClassName);
}
به طور مشابه، برای تبلیغات بینابینی، ویژگی adNetworkClassName را در GAMInterstitialAd درون interstitialDidReceiveAd بررسی کنید:
سویفت
func interstitialDidReceiveAd(_ ad: GAMInterstitialAd) {
print("Interstitial adapter class name: \(ad.adNetworkClassName)")
}
هدف-سی
- (void)interstitialDidReceiveAd:(GAMInterstitialAd *)interstitial {
NSLog(@"Interstitial adapter class name: %@", interstitial.adNetworkClassName);
}
GADMAdapterCustomEvents را برمیگرداند.