[iOS DEVELOPERS NOTE: Developed for Objective C. You cannot use 'use_frameworks' in your new project's podfile]

Interstitial Ads

Interstitial ads will display on both Android and iOS devices. In order to display our ads we need to pass Admob a few parameters. For more info on the app id and ad unit id visit http://google.com/admob.

Async Methods

There are two asynchronous functions that we use, one to load the ad and one to show it.

The plugin's loadInterstitial method accepts an APP_ID, AD_UNIT_ID, DEVICE_ID, and TESTING. The loadInterstitial method should be called in an init method to load an ad as the app starts. After that the ads will reload themselves whenever you close the previous one. The plugin's showInterstitial method accepts no variables, and as the name implies shows the ad you loaded with loadInterstitial. If the ad is not yet loaded the showInterstitial method will return false.

View the example code included with the plugin in the example folder to see usage. The main.dart file included in the example folder shows an implementation of the plugin.

Banner Ads [iOS Only]

We currently have limited support for banner ads on the iOS platform. Banner ads work largely the same way as our interstitial do. Unlike interstitial there is no load function. Whenever we want a banner we simply call showBanner. The showBanner method accepts an extra variable over the loadInterstitial:

The important new variable is PLACEMENT. You should pass either "Top" or "Bottom" in this variable when displaying a banner ad. This declares where the ad will be shown.

Banner Async Methods

We are now left needing our async functions. We have two of them, showBanner and closeBanner, they return a string that can be described as a banner state. If the ad is shown properly it returns "ShowingTop" or "ShowingBottom" depending on placement or else it returns "NotShown". A banner does not have to be closed. It is simple an option for people looking to display one temporarily: