Before proceeding this chapter, be sure that you already finished SDK settings. If not, check [6) Cocos2dx 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. [EventHandler] To catch events that occurs when an interstitial ad is loaded or when users close interstitial ads, use TnkAdEventHandler 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. Callbacks related to interstitial Ads are listed as follows.
Following sample code shows how developers can control displaying interstitial ads using TnkAdEventHandler. [Interstitial Ad APIs] API specs for prepareInterstitialAd() and showInterstitialAd(). - TnkPlugin::prepareInterstitialAd()Method - void TnkPlugin::prepareInterstitialAd(char *displayLogic) - void TnkPlugin::prepareInterstitialAd(const char *displayLogic, int handleId) Description It loads a single interstitial Ad from server and cache it in memory. Parameters
- TnkPlugin::showInterstitialAd()Method - void TnkPlugin::showInterstitialAd() Description It displays an interstitial ad which is loaded by previous prepareInterstitialAd() invocation. |
4. Interstitial Ad >