Tapping on ad in Windows Phone does nothing

(Using 4.6.0p1)

I’m using the MS Advertising SDK, and I’m adding an AdControl in the code behind to my game. The ad shows up for both Windows and Windows Phone, but if I tap on the ad on WP nothing happens. It works as expected on Windows. Has anyone else seen this? The XAML for my SwapChainPanel looks like this:

Code behind:
AdControl ad = new AdControl();
ad.ApplicationId = “XXX”;
ad.AdUnitId = “XXX”;
ad.Width = 300;
ad.Height = 50;
ad.IsAutoRefreshEnabled = true;
ad.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center;
ad.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
this.AdGrid.Children.Add(ad);

I don’t know what the problem is, but try actually adding the ad control into the XAML instead of creating it in code behind. Maybe check if the instantiated adcontrol is capturing the tap event. Is there a property in AdControl that determines if it can be tapped or not? Some controls have a property like that which is not enabled by default.

Hi,

I have already submitted a bug report: Unity Issue Tracker - Microsoft Ad Control does not open clicked ads on Unity WP8.1 builds

and I asked if they are going to fix this issue soon, but the answer i got is this: The bug will most likely get fixed later than 4.6.

1 Like

Is there a workaround? Surely they can’t leave a bug in that causes such a showstopping issue (i.e. ads not working)?

I tried almost everything, but didn’t found any solution…

I ran into the same problem & tried using the latest patch release of Unity 4.6 & 5.0 - neither resolved the issue. I posted a new thread on the forum, and got a response from someone at Unity. I did what they suggested (took a little trial & error) but I was able to make it so that the ads could be tapped on.

I’m going to post on that new thread the modifications I made to the xaml.cs code shortly.

As platicYoda shows in his other thread, the AdControl requires an Frame in the XAML tree to work properly.

The reason why the ad is not clickable without an Frame is because of this code in the onClick method in the AdControl:

if (this.applicationFrame != null)
{
     this.actionHandler = new ActionHandler(this.currentAd, new EventHandler(this.OnActionCompleted), this.applicationFrame);
     this.applicationFrame.OrientationChanged += new EventHandler<OrientationChangedEventArgs>(this.actionHandler.OnApplicationOrientationChange);
     if (this.IsEngagedChanged != null)
     {
          this.IsEngagedChanged(this, EventArgs.Empty);
     }
}

A person from Microsoft AdSDK team writes in an old forum post about this issue, and that this is a bug in the AdSdk, and that they will fix the problem.

Thore