Bug 26474 - GADInterstitial not showing for Google Admob Component (iOS)
Summary: GADInterstitial not showing for Google Admob Component (iOS)
Status: RESOLVED INVALID
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Israel Soto [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-01-27 14:35 UTC by Sergio Paganoni
Modified: 2015-02-04 12:22 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Sergio Paganoni 2015-01-27 14:35:11 UTC
The GADInterstitial.IsReady property is never true, and the events DidFailToReceiveAd and DidFailToReceiveAd are never triggered either.

I'm using the iOS simulator with version 8.1

On the debug log I just see:
App[2893:91112]  To get test ads on this device, call: request.testDevices = @[ GAD_SIMULATOR_ID ];

Here my code:

GADInterstitial adInterstitial = new GADInterstitial()
{
    AdUnitID = "*********************************"
};

var request = GADRequest.Request;
request.TestDevices = new[] { GADRequest.GAD_SIMULATOR_ID };

adInterstitial.DidReceiveAd += (sender, args) =>
{
    // Never triggered...
};
adInterstitial.LoadRequest(request);

I'm using the latest version on the Component Store (6.12.2)
Comment 1 Israel Soto [MSFT] 2015-02-03 12:37:43 UTC
Sergio,

I tried your code and everything went ok for me.

My guess is that your AdUnitID is not for an Interstitial Ad. Try this ID: ca-app-pub-3940256099942544/4411468910, is from Google AdMob samples.

Also, you need to ask again if the `IsReady` property is true, sometimes takes a few seconds to be ready, you can use this method to verify the property:

async void ShowInterstitial ()
{
	do {
	        await Task.Delay (100);
        } while (!adInterstitial.IsReady);

	InvokeOnMainThread (() => adInterstitial.PresentFromRootViewController ("yourViewController"));
}

The "request.TestDevices = new[] { GADRequest.GAD_SIMULATOR_ID };" is to tell to Google that you will test the ads on a simulator.
Comment 2 Israel Soto [MSFT] 2015-02-03 12:47:00 UTC
Oh I forgot…

adInterstitial.DidReceiveAd += (sender, args) =>
{
    // Never triggered...
};

This event only will be triggered when you call `PresentFromRootViewController
("yourViewController")` method and before the ad is shown.