Before proceeding this chapter, be sure that you already finished SDK settings. If not, check 5) Unity Settings first. [Incentive Interstitial Ad] To display incentive interstitial ads in your app, simply write down two lines of code as follows. [Non-Incentive Intestitial Ad] To display non-incentive interstitial ads in your app, simply write down two lines of code as follows. [Interstitial Ad APIs] API specs for prepareInterstitialAd() and showInterstitialAd(). - TnkAd.Plugin - prepareInterstitialAd()Method - void prepareInterstitialAd(string logicName) - void prepareInterstitialAd(string logicName, string handlerName) Description It loads a single interstitial Ad from server and cache it in memory. Parameters
- TnkAd.Plugin - showInterstitialAd()Method - void showInterstitialAd() Description It displays an interstitial ad which is loaded by prepareInterstitialAd() call before. [EventHandler] To catch events that occurs when an interstitial ad is loaded or when users close interstitial ads, use EventHandler objects. EventHandler is for getting return values from async invocations or getting events related to interstitial popup view. See B. EventHandler for details about EventHandler. Following sample code shows how developers can control displaying interstitial ads using EventHandler. [Back key (Android only)] Unity doesn't send back-key event to java side. So you have to add the following code to a script of yours that is attached to an active MonoBehaviour class. You can replace Application.Quit() with anything you want. |
4. Interstitial Ad >