Banner Ads¶
Flurry ad units represent unique placements in the app. If your app supports multiple ad placements, you need to create multiple ad units.
Use Flurry Analytics to find the places in your app with the highest user traffic and longest session times. Good placements include the top of the screen or a fixed location on the bottom of the screen of the Activity with the highest user traffic.
How To Display Banner Ads¶
To display banners within your app, follow these required steps illustrated in the code snippet below:
Initialize the Flurry system.
Display Banner Ads.
Important
Flurry recommends that you don’t set ad delegate to nil or remove the ad in the viewWillDisappear
or viewDidDisappear
method of the presenting view controller. When a user clicks on the banner add, the full screen ad is shown on the view controller passed into these routines. The viewWillDisappear
and viewDidDisappear
methods of this view controller are then called.
Once a banner is displayed, it is refreshed every 30 seconds while its containing UIViewController
is the top window. You can change the default 30-second refresh on the ad unit setup page in the dev portal.
Alternatively, you can fetch banners asynchronously when the view is loaded and display it when it is appropriate for your app. You can use one of the banner object’s properties, ready
, to find if the banner object is ready to be displayed.
For an object that implements the FlurryADBannerDelegate
protocol, you can display the banner as soon as the banners are made available by the SDK in the FlurryAdBannerDelegate’s adBannerDidFetchAd
call.
To be notified of certain events during the full lifecycle of the banner ad, implement the
FlurryAdBannerDelegate
protocol and then assign it to theadBanner
object you are working with.
The following callbacks may be useful:
Run the app to see the Banner ads displayed. You should now see ads similar to those below:
If you are not seeing any ads, check the troubleshooting section in FAQs for iOS for tips.
Learn More¶
For detailed information on the Objective-C classes and methods available in the SDK, check out the API Reference documentation for iOS.