Banner Ads
First of all, you need to create a BannerAdController object and init it (with your application context in parameter). After this, you have two possibilities:
  • Display as quickly as possible the ad after loading it. For this, you can simply call the method Adstronomic.loadAndShow with the app context and the ad object as parameters.
  • Just load the ad in the background by calling Adstronomic.loadBanner(). And, when you want to show the ad (after a specific event - For example: click on a button), you can do it with the method show.
So, for example:
Swift
1
var bannerAd: BannerAdController?
2
​
3
bannerAd = BannerAdController.initializeObject()
4
Adstronomic.loadAndShow(view: self, ad: bannerAd!)
Copied!
or
Swift
1
var bannerAd: BannerAdController?
2
​
3
Adstronomic.loadBanner()
4
bannerAd = BannerAdController.initializeObject()
5
​
6
...
7
​
8
// Call when a button is pressed for example
9
if bannerAd != nil {
10
bannerAd?.show(view: self.view)
11
}
Copied!
Copy link