I am using Google Admobs with ad mediations in my iOS application. It seems like there is battery draining issue because google ads are running even when app is in background. Is there something that i have to do to Pause google Ads when app enters background and resume when app become active. Thanks in advance.
Find the ad you want to change and click the drop-down next to the status icon. Change the status: Enabled: Selecting this status will enable the ad to be served. Paused: Selecting this status will pause this ad and it won't be served until you enable it.
Use test ads to avoid generating invalid clicks. It is important to enable test ads during development so that you can click on them without charging Google advertisers. If you click on too many ads without being in test mode, your account can be flagged for invalid activity.
You can definitely use Admob without uploading your app to Google Play.
Ads won't show if you haven't integrated the Google Mobile Ads SDK correctly. Is your ad implementation code working properly? Test your implementation code to check that ads can show. You can also use ad inspector to test your app's ad serving.
I have found a solution that has had mixed success for me. Hopefully someone can provide a more reliable solution. In AppDelegate.m I have this...
- (void)applicationDidEnterBackground:(UIApplication *)application {
[self.viewController.bannerView removeFromSuperview];
self.viewController.bannerView.delegate = nil;
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
[self.viewController loadAdBanner];
}
This works for one of my apps. If I just call removeFromSuperview and don't set the delegate for the bannerView to nil, I still see background activity for my app when I look in the battery usage on my phone (running iOS 13.5.1). I have another app where I am doing basically the same thing but I still see background activity regardless. In both cases I am using AdMob 7.61.0.
My bannerView is declared like this:
@property(nonatomic, strong) GADBannerView *bannerView;
In MyViewController.m I have a loadAdBanner function that looks something like this...
- (void)loadAdBanner {
...
[self.bannerView setDelegate:self];
self.bannerView.rootViewController = self;
[self.view addSubview:self.bannerView];
GADRequest *request = [GADRequest request];
[self.bannerView loadRequest:request];
...
}
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With