x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

c++ Interstitial Ads in Source 4.7

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

Product Version: Not Selected
Tags:
gameactivity.txt (31.0 kB)
more ▼

asked Mar 10 '15 at 11:30 AM in C++ Programming

avatar image

spaceharry
392 21 30 138

avatar image spaceharry Mar 24 '15 at 01:50 AM

Is this question to specific like stackoverflow? :D

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

4 answers: sort voted first

Hello,

We can help you. Our plugin Universal Mobile Ads for iOS & Android is exactly what you need: 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

more ▼

answered Dec 24 '17 at 03:57 PM

avatar image

gameDNA studio
121 8 15 23

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

See this video ADMOB Unreal Engine 4: https://www.youtube.com/watch?v=NWjnPNIWX1s

Simple method Working Interstial

more ▼

answered Jan 10 '16 at 06:58 PM

avatar image

tiagoalexandre
0 2 5

avatar image Anngel Feb 25 '16 at 05:45 PM

It works! Thank you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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

gameactivity.txt (33.3 kB)
more ▼

answered Apr 10 '15 at 08:37 PM

avatar image

spaceharry
392 21 30 138

avatar image Vasanth Jun 18 '15 at 11:58 AM

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

avatar image spaceharry Jun 18 '15 at 06:45 PM

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

avatar image RichardSo Nov 19 '15 at 06:24 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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: https://github.com/AnnaIvanova/UE4AdBoxPlugin

Hope it will help :)

more ▼

answered Feb 25 '16 at 12:26 PM

avatar image

Anngel
11 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question