InMobi - Stopping/Hiding banner ads - android

I'm using InMobi for displaying banners in my game - the ads will need to be turned off when the actual game starts (they only display on menu screens and when the game is paused) and I'm unsure how to do this.
With other networks I use/have used (including MobFox/AdMob), I could do something like this:
banner.pause();
banner.setVisibility(View.GONE);
This would hide the banners and stop requests.
However, in the InMobi SDK, there are no such methods (pause/resume).
If I set the visibility, the banners do disappear, but they keep refreshing (currently set to 60 seconds). This is no good. Requests/refreshes should most definitely, stop when the banners are not visible.
InMobi does have a .setEnabled(); which takes a boolean, but this does absolutely nothing.
Anyone who has used/is using InMobi, I would appreciate a point in the right direction.

Try setting the autorefresh to 0 to disable automatic requests. When you're ready to request for an ad, either request for one manually or re-enable auto refresh with a refresh value of at least 20 seconds, or, preferably, 60 seconds for banner ads

Related

Rewarded video from AdMob in Unity - loading so slow

Previously I used Unity Ads to display interstitial and rewarded ads in my game made with unity but now I'm switching to Google Ads (AdMob).
I read documentation from here and next from here and everything seems like it's working, but kinda slow.
I have 3 scenes:
Main Menu
Game
Shop
I need to display rewarded ads in Game and Shop scenes. In the Game scene, the user has the ability to watch an ad to continue where he dies. He have only 5 sec to do that. If he doesn't watch an ad, then he has the ability to watch another ad for +25 coins, to restart the game or to go to the main menu. From the Main Menu scene, the user has the ability to go to the store to buy some more characters and here he also has a button for +25 coins if he watches rewarded ad. So, there are 3 places for the rewarded ad.
In the Main Menu script, in the Start() method there is:
MobileAds.Initialize(appId);
The problem is, when the user clicks on the "Store" button in the Main Menu scene, in the Start() method I'm calling
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the rewarded video ad with the request.
rewardBasedVideo.LoadAd(request, adUnitId);
and the user has the ability to immediately click on "View ad" button which does this:
if (rewardBasedVideo.IsLoaded()) {
rewardBasedVideo.Show();
}
and there is a problem... Rewarded ad is still not loaded, it will be loaded after 1.5s - 2 s from calling rewardBasedVideo.LoadAd(request, adUnitId); So, the user must click it multiple times until ad appears.
I checked a lot of other games which uses AdMob and every game immediately show ads. How? Is there a way to preload rewarded ad?
It's also a bad UX when die modal appears and user have 5s to watch rewarded ad until he is "fully dead" but the ad is available after ~3s.
Also in the store, after watching the ad, user has ability to watch it again, so in OnAdClosed I putted the same logic for loading new ad but it's also slow and after few seconds the ad is actually loaded and I tested other games - they don't have that problem.
Do You have any advice?
You need to call
rewardBasedVideo.LoadAd(request, adUnitId);
As soon as the app launches.
This will load and prepare the ad for when the user is prompted to watch it.
I ussually have an empty gameobject with a script called "AdManager" which loads the ad. It has a static reference to itself (singleton pattern) so i can easilly call it from other scripts.
That way when the app launches, the ad is prepared and when I want to display it, i can call it from wherever i want to.
Regarding displaying a new one after the previous one has ended. I do not see a viable option other than physically having to wait untill it is loaded. (Keep in mind that an Ad can be pretty big in Data)

admob ads disappearing and delay

hi I am new in admob ads and I just start using it, I created a simple ad and it worked fine but when I exits the app and run it again the ad disappeared and stopped showing, and then I tried again after closing and opening the app the ad appeared after 60 seconds, any one know the reason of this.
It is likely that when no ad was showing there was no ad available for your app at that point in time. You may find that while your app is still making few requests that it doesn't always get an ad response.

How to make sure ad requests are not made when the screen is off

I am using admob ads in my mobile app. When I gone through the guidelines I found the below statement.
If your app is automatically refreshing ads, make sure ad requests are not made when the screen is off. Also, if users navigate to and from pages with ads in an application over a short period of time, a new ad request should not be made sooner than the recommended 60 second rate.
https://support.google.com/admob/answer/3245199?hl=en
Can you please tell me what I need to do that for "make sure ad requests are not made when the screen is off"
I am using codova admob pro plugin in to integrate ads. https://github.com/floatinghotpot/cordova-admob-pro
and using the code
if(AdMob) AdMob.createBanner( {
adId: admobid.banner,
position: AdMob.AD_POSITION.TOP_CENTER,
autoShow: true } );
Thankyou.
You do not need to do anything. The ad unit is automatically paused when the screen is off or your activity goes in background. You can monitor the logcat to verify this.
At least this is seen to be happening with Mopub which i use to mediate admob.
do not call your ad-refreshment code via service. Service can work in background even when app is not in foreground.
Call the code through some activity or fragment, which will automatically pause as soon as it goes into background

Does Admob performs requests when the app is in background?

I've integrated AdMob with my app. I can't seem to find this in any AdMob references.
Are AdMobs still running and bringing you revenue even if the app is in background or the ad is not visible? (for example
the user pressed the "Home" button
the user turned off the screen
the ad is positioned outside screen bounds
In my opinon this is clearly a wrong behavior if AdMob is still requesting ads and paying money per impressions in any of the above cases.
How does this actually work? Can anyone point me to a link/reference that exaplains this behavior?
Thanks
Clicking back, home, or closing your phone will pause your application but not terminate it. It is possible to run your application as a Service\WakeLock and it will continue to run in the background. Admob requests should not be running in the background if your application is paused. You should not be receiving impressions or revenue while your application is in the background.
Quote from AdMob: background requests?
You can see in LogCat when AdMob is requesting ad. Are you seeing any
requests when your app is in the foreground (you should), and when
your app pauses (you should not see any requests)?
By: Android Dev Guy

Android AdMob SDK - requesting a new Advert returns same Advert

I have an AdView in the main activity with its requestInterval set to (the recommended) 20 seconds.
The problem is that the Advert never seems to change.
I know that the refreshes are occurring as I get callbacks to onReceiveRefreshedAd on the AdListener, furthermore the impressions are being counted in the Sites and Apps Reporting control panel.
I can see that the AdView flickers just after the onReceiveRefreshedAd callback occurs, so my assumption is that AdMob is simply serving the same ad time after time.
The only way to get a new/different advert is to restart the activity.
This isn't the way its supposed to behave surely?
I'm not in test mode nor am I using a registered test device.
Thanks,
It is very common to return the same ad, as well as not returning any ads at all, the ads can have a specific target applications, which are with "higher" priority, so you are getting one of the ads that doesn't require anything in particular :)
EDIT: once your app becomes more popular, it will show different ads more frequently, so don't worry about it.

Categories

Resources