April 2021
Beginner to intermediate
506 pages
11h 57m
English
When the player purchases the “Remove Ads” product, you need to stop the banner ads from running—and only the banner ads. You don’t want to prevent rewarded ads from running because that’s how players receive “free” continues (and you receive extra revenue).
To selectively hide banner ads, you need to update the adViewDidReceiveAd(_:) delegate method in the AdMob helper file. You added that helper file in Add the AdMob Helper File.
Open the AdMobHelper.swift file and update the adViewDidReceiveAd(_:) delegate method to match this:
| | func adViewDidReceiveAd(_ bannerView: GADBannerView) { |
| | // print("adViewDidReceiveAd") |
| » | // Check for "Remove Ads" purchase |
| » | if GameData.shared.products.filter ... |
Read now
Unlock full access