iOS SDK Usage
Banner Ads
Once the initialization of the SDK is complete, you can get and load banner ads from the EMAManager.shared by using the following method:
viewController: ViewController of the banner that will be displayed.
zoneId: Banner id that will be loaded in the view. (It will be provided by us.)
bannerContainer: UIView that banner ad is loaded.
Optional(adStatusDelegate) self : AdStatus callback for the status of banner.
customParameters(Optional): You can pass custom key-value pairs to target Google Ad Manager campaigns.
keywords(Optional): If you are using keywords for targeting, send your parameters as string value.
EMAManager.shared.loadBannerAd(viewController, zoneId, bannerContainer)
If you set AdStatusDelegate, once loadBannerAd method is called, one of these three will happen:
bannerStatusChangedwill be called withstatusofbannerManagerset toAdStatus.ready.bannerStatusChangedwill be called withstatusofbannerManagerset toAdStatus.failed.- If ads are disabled or the user is in an unfinished ad session, then 
loadBannerAdcall will be ignored and nothing will happen. 
As AdStatusDelegate, you should listen to the bannerStatusChanged events and display the ad based on its status.
func bannerStatusChanged(_ manager: DFPBannerManager) {if manager.status == .ready {self.view.addSubview(manager.banner)}}
Full Example:
Without Setting Delegate:
class ViewController: UIViewController {@IBOutlet weak var bannerContainer: UIView!override func viewDidLoad() {super.viewDidLoad()// Do any additional setup after loading the view.EMAManager.shared.loadBannerAd(self, "153468", bannerContainer)}}
With Setting Delegate
class ViewController: UIViewController, AdStatusDelegate {@IBOutlet weak var bannerContainer: UIView!override func viewDidLoad() {super.viewDidLoad()// Do any additional setup after loading the view.EMAManager.shared.loadBannerAd(self, "153468", bannerContainer)}func bannerStatusChanged(_ manager: DFPBannerManager) {if manager.status == .ready {// TODO: Banner related operations after load}}}
Interstitial Ads
Load Interstitial
- Swift
 - Objective-C
 
class ViewController: UIViewController {var interstitialManager: EmpowerZoneManager!override func viewDidLoad() {super.viewDidLoad()// Do any additional setup after loading the view.interstitialManager = EMAManager.shared.loadInterstitial(zoneId: "zoneId")}}
Note: zoneId will be provided by us.
Show Interstitial ad
After interstitial ad loaded successfully, call showInterstitial() method of interstitialManager that you initialize in viewDidLoad whenever you want to show interstitial ad.
interstitialManager.showInterstitial()
By setting  delegate as second parameter in loadInterstitial, you can listen to the status events of interstitial ads. These events are:
AdStatus.readyinterstitial is ready for display.AdStatus.failedinterstitial is failed to load an ad.AdStatus.presentinterstitial is displayed and is on screen.AdStatus.willLeaveinterstitial is redirecting user either to a URL or to App Store.AdStatus.usedinterstitial is dismissed and needs reloading for another display.
Rewarded Ads
Rewarded ads are the ads where users have the option of interacting with in exchange for in-app rewards.
Load Rewarded Ad
- Swift
 - Objective-C
 
class ViewController: UIViewController, AdStatusDelegate {private var empowerManager: EmpowerRewardedManager!override func viewDidLoad() {super.viewDidLoad()// Do any additional setup after loading the view.EMAManager.shared.loadRewarded(zoneId: "zoneId")}// MARK: AdStatus Listenerfunc empowerRewardedAdStatusChanged(_ manager: EmpowerRewardedManager) {if empowerManager == nil {empowerManager = manager}if manager.status == .ready {manager.showRewarded()} else if manager.status == .rewarded {// User earned reward.}}}
Show Rewarded Ad
After rewarded ad loaded successfully, call showRewarded() method of empowerManager that you initialize in viewDidLoad whenever you want to show rewarded ad.
empowerManager.showRewarded()
By setting  delegate as second parameter in loadRewarded, you can listen to the status events of rewarded ads. These events are:
AdStatus.readyrewarded ad is ready for display.AdStatus.failedrewarded ad is either failed to play or failed to load.AdStatus.presentrewarded ad is present on the screen.AdStatus.rewarduser earns the reward.
App Open Ads
App open ads are a special ad format intended for publishers who wants to monetize their app load screens. App open ads are designed to be shown when your users bring your app to the foreground.
Empower SDK automatically loads the App Open Ads when application becomes active.
Show App Open
Call showAppOpen function in AppDelegate's applicationDidBecomeActive method.
func applicationDidBecomeActive(_ application: UIApplication) {EmpowerAppOpenManager.shared.showAppOpen()}
If you are using SceneDelegate, call showAppOpen function in SceneDelegate's sceneDidBecomeActive method.
func sceneDidBecomeActive(_ scene: UIScene) {EmpowerAppOpenManager.shared.showAppOpen()}