MonkeySteve
MonkeySteve

Reputation: 99

Xamarin.iOS:Google ads didn't display on my device

Now I'm using google ads . I followed the step from here(convert OC to C#).And I have add a new adUnitID .It built without error.However.My bannerView didn't display on my test device.Any advice? I know from other forum that google admob will be blocked in some countries, is that true?

in Appdelegate.cs

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
    Window.RootViewController = new XttcViewController();
    Window.MakeKeyAndVisible();
    MobileAds.Configure("xxx");

    return true;
}

in ViewController.cs

public override void ViewDidLoad()
 {
   base.ViewDidLoad();

   this.bannerView = new BannerView(new CGRect(0,100,320,50));
   View.AddSubview(this.bannerView);

   this.bannerView.AdUnitID = "xxx";
   this.bannerView.RootViewController = this;
   this.bannerView.LoadRequest(Request.GetDefaultRequest());          
}

Upvotes: 0

Views: 59

Answers (1)

Lucas Zhang
Lucas Zhang

Reputation: 18861

If you have recently created an AD unit ID(in 24 hours), it may take some time and several AD requests to build up AD resources. Because of this, you may not immediately see the actual presentation. You can use the test unitID. Please note that the test AD runs through the same channels as the actual AD. If the test AD returns, your application is communicating correctly with the network.

The test ID for bannerview in iOS is "ca-app-pub-3940256099942544/2934735716".

If your issue persists even if you use the test ID.You can check for more specific causes from the google support

Upvotes: 1

Related Questions