AdMob interstitials in app with single activity - android

I'm considering replacing regular ads with interstitials in our apps. I've got numerous emails from AdMob encouraging me to do this.
The problem is that our apps are live wallpapers so there's only one actual activity in them - live wallpaper settings. I can't think of any good implementation of interstitials periodic appearance.
According to guidelines, this type of ads must be shown between some interactions, like navigating from one activity to another.
I can show fullscreen ads every time after returning from live wallpaper settings activity to home screen, making sure user haven't seen interstitial like 3 min before (so users don't see them too often, because they can go to settings quite often).
It is possible to use AdMob interstitial ads in such scenario or not?

I can show fullscreen ads every time after returning from live
wallpaper settings activity to home screen, making sure user haven't
seen interstitial like 3 min before (so users don't see them too
often, because they can go to settings quite often).
This is good, can be implemented...
However, you can also use / show Interstitial Ads on App Exits...
For e.g. > User Presses Back > Load Interstitial > Ad Closed > Show App Exit Confirmation Dialog > User selects Exit > Call finish();
but if you do this -
User Presses Back > Load Interstitial > Ad Closed > Call finish() -- This is against policy...

When you are going to settings you should load the ad and whenever user click on some button check if the ad is loaded, if it is then show the ad and perform the action on ad closed, else perform the action.
You can also use shared preferences to keep record of user interaction. Set a specific limit and when shared preferences reaches that call for the ad load

Related

How to avoid destroying app when an AdMOb banner is clicked?

I am using AdMob banner adds in my game. When I click on the add, I want app to pause while the user is taken to the ad content.
What is happening is that the app is completely destroyed and onCreate is called when I go back to the app.
How to resolve this?

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)

Android: Show Interstitial Ad after user pressed notification

Currently in my application when user presses notification an Activity is shown, what I want to do is to add Google Interstitial Ad in between (after user pressed notification and before the activity is shown). The problem is that it may take time for the ad to load. What would be the best approach to implement this?
Preload the ad when application is started to reduce the ad loading time.
But generally there is no magic solution. If the add takes time to load, give it that time, show a progress bar while it is loading. And only after the user interacted with the add, move to next activity.

Blocking "Back" button to Close Interstitial Ad

I am adding interstitial ads to my android app using AdMob. I am wondering if there is a way to prevent users from closing them via pressing the "back" button (so they'd have to press the "x" button on the ad).
I know that AdMob is loading the ad in another activity, so I can't use my activity's onKeyDown() to do that.
Also, I am not sure if it's considered a good practice and if it's worth doing at all.
Thank you!
Update:
It appears that there is no easy way to override the back button in the ad's activity (since I don't have access to that activity). Thus, I'll give up on it.
However, I still haven't found any evidence that it is against admob or android policy. In most of android games the back button is overridden to turn the pause mode on and off (as opposed to go further back and eventually exit) and everyone seems to be okay with it. Therefore, I am still open to hear about this aspect from the people that actually know the answer.
P.S.: to the people that say that it's such a horrible thing to block the back button:
I agree that this would make it more annoying for users, but the very idea of interstitial ads is pretty annoying to begin with. Despite of that, it is the most commonly used type of ads these days (guess why - it's just more profitable).
Now, most of the time if you use the back button you can close the ad even before it is loaded on the screen (I'm talking about loading of the layout, not loading of the data from the ad provider). But the whole idea of having ads is to show them to people. So, I think it is reasonable to allow users to close the ad only after it is fully loaded to the screen and not before that. And people that are saying otherwise (but at the same time not having anything against the very concept of interstitial ads) are hypocritical.
Check Google/Android policy for overriding the Back button while publishing your app. Obviously they don't like it either as you disable a main feature from user stand-point.
But if you really need to avoid pressing the back button just override onBackPressed(), you can leave this function blanked.
If you subclass the AdMob activity, then you can override its onBackPressed method to do nothing.
This has recently been fixed by Google. If you update to SDK 19.3.0+ the back button will stop working when an interstitial ad is shown. You must now use the close or x button.
implementation 'com.google.android.gms:play-services-ads:19.6.0'
Source:
Can't dismiss Admob Interstitial Ads by pressing Back key button of Android device
Admob Interstitial ad is not closing when user presses back button on android 7,8,9 but works fine on android 10 and 6

Strange behavior after user clicks adMob ad

I have successfully added admob ads to my android app and can view test ads on the emulator and my development phone (Nexus One). When I click on one of the test ads, it opens the web browser or market to that particular page(gmail or whatever). I click the home button to exit, but when I try to start my app again, it takes me back to the market page or browser that came up when clicking the test ad.
I have a feeling it is something in the onLeaveApplication or onPresentScreen methods implemented with AdListener, but I'm lost and the adMob documentation doesn't provide much info on this.
Generally this is the expected behavior for an application. If you click home and then back on your application icon, most applications will jump back to the last activity on the stack. It's certainly possible to kill your application altogether and treat re-entry as a brand new instance of your application, but you probably don't want that either as all user state will be lost unless you explicitly save it, which is even more work.
The AdMob client SDK listener callbacks are all optional for you to implement; there's no expectation that you do anything in particular. They're there as a convenience for you to pause, save, or resume whatever activity you were doing before.
Users are generally used to hitting the back button to go back to your app, not home and then back into the app.

Categories

Resources