Instead, just a blank view is appearing.
Here's how I load the ad request:
GADMobileAds.configure(withApplicationID: "ca-app-pub-9213331484438711~8534798836") // actual app id
bannerView.delegate = self
bannerView.rootViewController = self
bannerView.adSize = kGADAdSizeLargeBanner
// unit id taken from guide: https://firebase.google.com/docs/admob/ios/quick-start
// Actual unit id doesn't work either.
bannerView.adUnitID = "ca-app-pub-3940256099942544/2934735716"
let request = GADRequest()
request.testDevices = [kDFPSimulatorID]
bannerView.layoutIfNeeded()
bannerView.load(request)
I've set Allow Arbitrary Loads
to YES
, but this didn't help. Delegate methods don't even get called. Am I missing something? Has anyone been able to get Admob working in an iMessage extension?
A sample project can be found here.
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.
Stay organized with collections Save and categorize content based on your preferences. This quickstart guide is for publishers and developers who want to use AdMob to monetize an app that's built with Firebase.
Ad serving When apps are newly registered with AdMob, it typically takes up to an hour and a few ad requests to allow inventory to build. Because of this, you may not see live impressions immediately. Note: In some cases, it may take longer than an hour. Please wait 24 hours before seeking additional help.
To configure your app to carry ads, you must integrate an Google Play Instant-compatible ad-network SDK into your app. The Google Mobile Ads Lite SDK is one such SDK. For more information about integrating an ad-network SDK, see the guides related to Google Mobile Ads Lite SDK and Google AdMob.
From the AdMob team as of Aug 7, 2017:
Thanks for reaching out to us. Our SDK does not support Messages extension. You can keep an eye out for our release notes or monitor our blogs if this ever changes.
Regards, Deepika Uragayala Mobile Ads SDK Team
I'm not sure it is possible to have ads in an app extension. Either way, there is a review guideline prohibiting it. From iAds don't work in Action Extension or Share Extension?:
Review criteria 25.3: https://developer.apple.com/app-store/review/guidelines/#advertising
- 25.3: Apps hosting extensions that include marketing, advertising, or in-app purchases in their extension view will be rejected
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