0

Is there any way to preload fullscreen ad on Unity? Right now when we call it using

revmob.ShowFullscreen(); 

when we create end game screen. But most of the time it loads after 5/10 secs later which is in-game most probably if you press restart, so it shows a full screen ad during gameplay.

I've found some ways to preload it on native android and tried same function to see if they exists in Unity but no luck.

Thanks.

kreys
  • 987
  • 4
  • 21
Edenrim
  • 241
  • 1
  • 3
  • 7

3 Answers3

1

Yes! You can use the following code:

private RevMobFullscreen fullscreen;
fullscreen = revmob.CreateFullscreen();
fullscreen.show();

If you need more information, you can access RevMob mobile ad network website: https://www.revmobmobileadnetwork.com

0

It will be better to add this code to the Create statement:

private RevMobFullscreen fullscreen;
fullscreen = revmob.CreateFullscreen();

...and then also this code to the listener:

RevMobAdsListener revmobListener = new RevMobAdsListener() {

    // Required
    @Override
    public void onRevMobSessionIsStarted() {
        fullscreen.show();
    }

(...)
}

This will show the fullscreen ad.

aprados
  • 374
  • 4
  • 16
0

You can do like this to preload revmob videos in unity. But there are memory leaks in revmob unity videos and they might fix that in 9.2.x...

REVMOB_APP_IDS = new Dictionary<string, string>() {
            { "Android", androidMediaId},
            { "IOS", iosMediaId }
};
revmob = RevMob.Start (REVMOB_APP_IDS, gameObject.name);


public void SessionIsStarted ()
{
    CacheVideoInterstitial("Bootup");
}

public void CacheVideoInterstitial(string location) {
    DestroyVideo();
    StartCoroutine(CacheAfterEndofFrame(location));
}

IEnumerator CacheAfterEndofFrame(string location) {
    yield return null;
    fullscreenVideo  = revmob.CreateVideo(location);    
}

void DestroyVideo() {
    if( fullscreenVideo != null ) {
        fullscreenVideo.Hide();
        //fullscreenVideo.Release();
        //fullscreenVideo = null;
    }
}

// revmob ad closing delegate
public void UserClosedTheAd (string revMobAdType)
{
    DestroyVideo();
    CacheVideoInterstitial(this.location);  
}
Kenshin
  • 1,030
  • 2
  • 12
  • 41