# C++ Interstitial Ads in Source 4.7

**URL:** <https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288>\
**Category:** Mobile\
**Tags:** unreal-engine, Android, CPP, question\
**Created:** [March 10, 2015, 11:30am UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288 "2015-03-10T11:30:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![spaceharry](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spaceharry](https://forums.unrealengine.com/u/spaceharry)\
**Post date:** [March 10, 2015, 11:30am UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/1 "2015-03-10T11:30:21Z")

</div>

I tried to implement interstitials from Admob on Android, but the ad doesn’t show up when  
I call it with a 5s delay after event begin play.

Banner ads work without problems on the same engine 4.7 source from github and  
the GameActivity file runs through packaging without errors.

My GameActivity.java file is attached. All my changes there are marked with //peep comment.  
link text

**What I did:**

**[KismetSystemLibrary.h/cpp]**

- Added a new node called ShowIntAd, so I could call the interstitial from blueprint as well
- Implementation similar to banner, but with provider pointing to ShowIntAd

**[AndroidAdvertisments.h/cpp]**

- Added ShowIntAd() as a new virtual function in the interface
- ShowIntAd function similar to the banner but with AndroidThunkCpp\_ShowIntAd without bool

**[AndroidJNI.h/cpp]**

- Defined AndroidThunkJava\_ShowIntAd as a new FindMethod
- added jmethodID FJavaWrapper::AndroidThunkJava\_ShowIntAd;
- made function void AndroidThunkCpp\_ShowIntAd(const FString& AdUnitID)

**[GameActivity.java]**

- import com.google.android.gms.ads.InterstitialAd;
- private InterstitialAd interstitial;
- Implemented method "void AndroidThunkJava\_ShowIntAd(String AdMobAdUnitID)
- Added interstitial.show and \_activity.interstitial.loadAd(adRequest) to method “private void updateAdVisibility”

Maybe I have to include something in some build.cs somewhere in the engine source? Or GameActivit.java has to be changed in another way?

[Admob Link]  
[link text](https://developers.google.com/mobile-ads-sdk/docs/admob/android/interstitial)

---

<div class="post-metadata">

**Author:** ![spaceharry](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spaceharry](https://forums.unrealengine.com/u/spaceharry)\
**Post date:** [March 24, 2015, 1:50am UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/2 "2015-03-24T01:50:50Z")

</div>

Is this question to specific like stackoverflow? 😃

---

<div class="post-metadata">

**Author:** ![spaceharry](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spaceharry](https://forums.unrealengine.com/u/spaceharry)\
**Post date:** [April 10, 2015, 8:37pm UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/3 "2015-04-10T20:37:11Z")

</div>

I had a look (or two 🙂 at it again and was finally able to display interstitial ads with the gameactivity.java file attached.

It preloads an ad in the oncreate function and every time after the ad is closed. This way I don’t get the delay from requesting to showing the ad. The ad itself displays everytime its called from custom blueprint node ShowIntAd.

I had some app crash on start up with error “In the JNI\_OnLoad function” when I tried to add another FindMethod in AndroidJNI source files for my custom BP node. So so far I have to input the AdUnitId manually in the OnCreate function. Maybe some better solution comes up.link text

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d5819e21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d5819e21](https://forums.unrealengine.com/u/anonymous_user_d5819e21)\
**Post date:** [June 18, 2015, 11:58am UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/4 "2015-06-18T11:58:04Z")

</div>

Hi have you tried this for iOS? If yes I would love to get more information 🙂

---

<div class="post-metadata">

**Author:** ![spaceharry](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spaceharry](https://forums.unrealengine.com/u/spaceharry)\
**Post date:** [June 18, 2015, 6:45pm UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/5 "2015-06-18T18:45:48Z")

</div>

No unfortunately not. But I guess you can follow along the same path where the ShowAd function goes in to the iOS module.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_df0ba6a8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_df0ba6a8](https://forums.unrealengine.com/u/anonymous_user_df0ba6a8)\
**Post date:** [November 19, 2015, 6:24pm UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/6 "2015-11-19T18:24:24Z")

</div>

Hi spaceharry, how do you recompile the engine changes so that the new blueprint function appears ?.. Do I need to download the engine source from github ? Thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0ac3f0d2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0ac3f0d2](https://forums.unrealengine.com/u/anonymous_user_0ac3f0d2)\
**Post date:** [January 10, 2016, 6:58pm UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/7 "2016-01-10T18:58:44Z")

</div>

See this video ADMOB Unreal Engine 4:

  
Simple method Working Interstial

---

<div class="post-metadata">

**Author:** ![Anngel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anngel](https://forums.unrealengine.com/u/Anngel)\
**Post date:** [February 25, 2016, 12:26pm UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/8 "2016-02-25T12:26:59Z")

</div>

Hi

We’ve made a plugin that adds AdMob interstitial support for Android platform in UE4 blueprints for UE4 starting from 4.10.

You can find it here: [GitHub - AnnaIvanova/UE4AdBoxPlugin: Plugin that adds AdMob interstitial support for Android platform in UE4 blueprints](https://github.com/AnnaIvanova/UE4AdBoxPlugin)

Hope it will help 🙂

---

<div class="post-metadata">

**Author:** ![Anngel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anngel](https://forums.unrealengine.com/u/Anngel)\
**Post date:** [February 25, 2016, 5:45pm UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/9 "2016-02-25T17:45:34Z")

</div>

It works! Thank you!

---

<div class="post-metadata">

**Author:** ![gameDNA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gamedna/32/1209504_2.png) [@gameDNA](https://forums.unrealengine.com/u/gameDNA)\
**Post date:** [December 24, 2017, 3:57pm UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/10 "2017-12-24T15:57:05Z")

</div>

Hello,

We can help you. Our plugin Universal Mobile Ads for iOS & Android is exactly what you need: [Universal Mobile Ads for iOS & Android - Marketplace - Unreal Engine Forums](https://forums.unrealengine.com/unreal-engine/marketplace/65633-holiday-sale-40-universal-mobile-ads-for-ios-android) It includes support for 15 ad networks (more coming soon) and Banners, Interstitials, Rewarded Videos. Plugin was released 2 years ago and was tested in many ways during this time. It’s stable, receives update every 1-2 months ,and we provide premium support.

If you have any questions, feel free to ask! 🙂

Patrick,  
gameDNA Ltd

---

<div class="post-metadata">

**Author:** ![PragmaticSystematic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pragmaticsystematic/32/88709_2.png) [@PragmaticSystematic](https://forums.unrealengine.com/u/PragmaticSystematic)\
**Post date:** [September 23, 2021, 1:39pm UTC](https://forums.unrealengine.com/t/c-interstitial-ads-in-source-4-7/310288/11 "2021-09-23T13:39:52Z")

</div>

The video is down.
