Punniyam Moorthi
Punniyam Moorthi

Reputation: 893

Ad control does not show anything and disappear on windows phone apps

I have created a windows phone app that support on 7.1 and 8.0 OS. I have added an AdControl at the bottom of my app to show ads in my app. While using testing ApplicationId and Adunit Id it shows default microsoft add on both emulator and my device, but when I use my ApplicationId and Addunit Id and run on my phone it does not showing add and it'll disappear after some time.

I have seen lots of websites and followed those steps, but its not working.

I am using Visual studio express 2012 for windows phone and Microsoft Advertising SDK for Windows Phone-ENU version 6.2.960.0.

WMAppManifest.xml capabilities checkbox checked

ID_CAP_IDENTITY_USER
ID_CAP_MEDIA_LIB
ID_CAP_NETWORKING
ID_CAP_PHONEDIALER
ID_CAP_WEBBROWSERCOMPONENT

obiously i have enabled all capabilities

Here is my code

mainPage.xaml code:

<my:AdControl Visibility="Visible" ErrorOccurred="OnAdError_ErrorOccurred" AdUnitId="10020750" ApplicationId="e1e3c23b-3a59-4119-852e-8ad0a7f78f11" Height="80" HorizontalAlignment="Left" Margin="-12,6,0,0" Name="adControl1" VerticalAlignment="Top" Width="480" />

and mainPage.cs code

using Microsoft.Advertising.Mobile.UI;

namespace WP_AdApp
{
    public partial class MainPage : PhoneApplicationPage
    {
        private AdControl adControl;
        private const string APPLICATION_ID = "e1e3c23b-3a59-4119-852e-8ad0a7f78f11";
        private const string AD_UNIT_ID = "10020750";

        public MainPage()
        {
            InitializeComponent();
            Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

        private void OnAdError_ErrorOccurred(object sender, Microsoft.Advertising.AdErrorEventArgs e)
        {
            MessageBox.Show("AdControl error: " + e.Error.Message);
        }
    }
}

I have testing with OnAdError_ErrorOccurred event handler to get errors on ad control. While running I got an error that shows:

HTTP status error code: Not found (404).

the application ID and Adunit Id are real values and am developing application in india., and

my internet connections are perfect, i have opened some webpages in IE and works perfect.,

Upvotes: 2

Views: 3016

Answers (1)

A.K.
A.K.

Reputation: 3331

Is your app deployed on the marketplace? If No then ads appear after once the app gets deployed. Till then its simply a 404 server not found error. You can't get the ads till your app do not get deployed on the marketplace. You will keep getting this message till you don't deploy it.

Upvotes: 2

Related Questions