Native Custom Ads not calling delegate

554 views
Skip to first unread message

Neil Foley

unread,
Jun 19, 2017, 2:51:50 PM6/19/17
to Google Mobile Ads SDK Developers
We are encountering an issue where we are requesting a native advert and not getting a response, this appears to be when we request the advert whilst in the background. Requesting in the background is a bug on our end, but we should at least receive a delegate callback to say the request has failed.

We request the advert using:

self.adLoader = [[GADAdLoader alloc]

                         initWithAdUnitID:<OUR SITE ID GOES HERE>

                         rootViewController:self.fetchRequest.rootViewController

                         adTypes:@[kGADAdLoaderAdTypeNativeCustomTemplate]

                         options:nil];

        self.adLoader.delegate = self;

        

        DFPRequest *request = [DFPRequest request];

                

        [self.adLoader loadRequest:request];


We have implemented the following two delegate callbacks


#pragma - mark GADAdLoaderDelegate

- (void)adLoader:(GADAdLoader *)adLoader didFailToReceiveAdWithError:(GADRequestError *)error 


#pragma - mark GADNativeCustomTemplateAdLoaderDelegate

- (void)adLoader:(GADAdLoader *)adLoader didReceiveNativeCustomTemplateAd:(GADNativeCustomTemplateAd *)nativeCustomTemplateAd


Is there a delegate method that we should be implementing or is there an issue where a delegate may not always get called?


Thanks for your help


Neil Foley

unread,
Jun 19, 2017, 3:08:48 PM6/19/17
to Google Mobile Ads SDK Developers
I should say we are using iOS 10.3.2 and framework version 7.20.0

Deepika Uragayala- MobileAds SDK team

unread,
Jun 19, 2017, 4:43:31 PM6/19/17
to Google Mobile Ads SDK Developers
Hi Neil,

Those two mentioned callbacks should give you all the relevant details of the AdView lifecycle. It sounds like an implementation issue to me and I would suggest that you first try with this sample app and then let us know.

Regards,
Deepika Uragayala
Mobile Ads SDK Team

Neil Foley

unread,
Jun 20, 2017, 10:25:13 AM6/20/17
to Google Mobile Ads SDK Developers
Hi Deepika

Thanks for your help, I have attached a sample project to show the issue we are having. Please add an advert id and template id to the project to make it work, I have also not included your sdk to reduce the file size.

The project uses a background task to keep the sample app alive in the background, as the app resigns active an advert request is made and no response is ever received. Removing the background task guarantees a response from the SDK.

Steps to reproduce
1. Launch app
2. Background the app
    -  Notice the app will make an advert request but never get a response
3. Launch the app
    - There is still no response

Please do let me know if I need to clarify anything.

Thanks

Neil
DFPNativeHang.zip

Deepika Uragayala- MobileAds SDK team

unread,
Jun 20, 2017, 2:07:47 PM6/20/17
to Google Mobile Ads SDK Developers
Hi Neil,

You are not supposed to make an ad request when the app is backgrounded. The one you have is not a valid setup. Make the ad request when the app is active and let us know if you are still facing the issue.

Regards,
Deepika Uragayala
Mobile Ads SDK Team

Eric Leichtenschlag (Mobile Ads SDK Team)

unread,
Jun 20, 2017, 3:58:35 PM6/20/17
to Google Mobile Ads SDK Developers
Hi Neil,

Thanks for providing a sample. I wasn't able to reproduce the error on my end. That is, I was getting the "Fail" log message inside of the ad failed to load callback. I was testing on a 10.2 simulator since I have Xcode 8.2 installed at the moment. I wouldn't expect there to be much of a difference here on 10.3 though.

Here (https://drive.google.com/open?id=0B26oUFN8YgnQNGRjMWU2dmNGR0U) is a revised version of your app with our demo custom template ad unit/template ID set up, and including the SDK (app should run out of the box). Can you confirm if this is specific to 10.3, or if it happens on any other iOS version as well?

The SDK should always send either a success or failure callback for every request. If we can reproduce this on our end, I'll file a bug to get this fixed.

Thanks,
Eric

Eric Leichtenschlag

unread,
Jun 20, 2017, 6:30:30 PM6/20/17
to Google Mobile Ads SDK Developers
Hi Neil,

I was testing this again, and I'm not sure what changed, but now I am able to reproduce the problem on 10.2. I will file a bug internally.

In the meantime, the workaround, as you mentioned, don't request the ad in the background.

Thanks,
Eric

Neil Foley

unread,
Jun 21, 2017, 5:33:14 AM6/21/17
to Google Mobile Ads SDK Developers
Hey Eric

Thanks so much for your help, I was seeing this bug on an iPhone 7 running 10.3.2.

We are guarding against requests in the background but the bug will still happen with a launch then background in quick succession.

Let me know if you need any more information.

Thanks again for looking into this

Neil

Neil Foley

unread,
Jun 21, 2017, 8:53:37 AM6/21/17
to Google Mobile Ads SDK Developers
One last thing Eric

Do you have an ETA for when this fix should be available?

Thanks

Neil

Eric Leichtenschlag (Mobile Ads SDK Team)

unread,
Jun 21, 2017, 1:12:18 PM6/21/17
to Google Mobile Ads SDK Developers
Hi Neil,

I'm still lobbying internally to get this prioritized; I'm not comfortable providing an ETA until I know what release this will be targeted to.

Thanks,
Eric

Eric Leichtenschlag (Mobile Ads SDK Team)

unread,
Aug 11, 2017, 1:04:30 PM8/11/17
to Google Mobile Ads SDK Developers
Hi Neil,

iOS SDK 7.22 has just been released, and includes a fix for the failure callback not being invoked due to the ad being requested on a background thread.

Thanks,
Eric

Neil Foley

unread,
Aug 11, 2017, 1:32:42 PM8/11/17
to google-adm...@googlegroups.com
Hey Eric

Thanks so much for fixing this, we’ll try and get it included as soon as possible. 

Neil

Sent from my iPhone
--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/r2kya0ZZ--Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages