3

I am using google advance native Ad. My Ad is display successfully on simulator and device when I run from Xcode, but when my app is live then one day Ad display on all device then another day Ad is not display in any one device whats problem in my code please help me.

Mainview is GADUnifiedNativeAdView

cell.Mainview.nativeAd = nativeAd

cell.Mainview.mediaView?.mediaContent = nativeAd.mediaContent

(cell.Mainview.iconView as! UIImageView).image = (nativeAd.icon)?.image

cell.Mainview.iconView?.isHidden = nativeAd.icon == nil

(cell.Mainview.bodyView as! UILabel).text = nativeAd.body

cell.Mainview.bodyView?.isHidden = nativeAd.body == nil

(cell.Mainview.headlineView as! UILabel).text = nativeAd.headline

(cell.Mainview.callToActionView as! UIButton).setTitle(
                                nativeAd.callToAction?.uppercased(), for: UIControl.State.normal)
cell.Mainview.callToActionView?.isHidden = nativeAd.callToAction == nil
                        cell.Mainview.callToActionView?.isUserInteractionEnabled = false

Note : I also applied all privacy and policy of Ad.

madlymad
  • 6,367
  • 6
  • 37
  • 68
ikbal
  • 1,114
  • 1
  • 11
  • 30

1 Answers1

2

I don't think this is a code related issue. I think an ad is not loaded from GMA SDK. Implementing a native ad does not necessarily mean an ad will always be available for display. Are you sure that GADUnifiedNativeAdLoaderDelegate's

func adLoader(_ adLoader: GADAdLoader, didReceive nativeAd: GADUnifiedNativeAd)

function is being called when the ad is not displayed? My suggestion would be to add a firebase event or log to GADAdLoaderDelegate's

func adLoader(_ adLoader: GADAdLoader, didFailToReceiveAdWithError error: GADRequestError)

function to see if some of your adLoader.load(GADRequest()) functions are failing or not. You might be getting "Request Error: No ad to show" request error.

Ayazmon
  • 1,360
  • 8
  • 17
  • i have received Ad, Because i already set firebase log event when Ad is received then my firebase log event display Ad is received but not display second day after live app. – ikbal Nov 20 '19 at 13:06
  • Have you ever received a fail event after your app went live? Since your app sometimes displays ads it is normal to get "Ad received event". For example when the app tries to load 10 ads and loads 5 of them successfully you'll get 5 "Ad received" events but if you have add an event at `didFailToReceiveAdWithError` function there should also be 5 "Ad failed event" events. – Ayazmon Nov 21 '19 at 09:28