MG Console Operation Guide

Sign up for Miracle Games developer account

Log in to the console of Miracle Games and click "Register now".

Application management - Create Application

Advertising platform - create advertising space

Advertising access

Download the Miracle Games SDK

You need to initialize the SDK before accessing the advertisement

Miracle Games advertising support[Open Screen 1920*1080][Banner 728*90][Insertion Screen 640*640][Couplets 300*600][Full Screen 768*432][Popup]

Open Screen,FullScreenInterstitial,Exit,Banner,Insertion,Couplets

After creating the open screen, banner, insertion screen and couplet advertising space in the console of MG, insert the following code in the relevant position of the apps code.

Open Screen

The open screen AD space is implemented in the load method of the mainPage page


public async void ShowSpreadnAd()
{
	//“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。	
	var fiAd = await AdvertisingManager.ShowAd(“XXXXXXXX”, AdType.FullScreen);
	if (ad.ReturnValue)//When the advertisement is closed, the advertisement closing event is triggered and MgAd_AdClosed is executed or do not register the event.
	{
			   
	}
}


Platform::String^ MainPage::SpreadnAd()   //MG FullScreenAd
{
	//“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。
	auto initTask = Concurrency::create_task(MiracleGames::AdvertisingManager::ShowAd("XXXXXXXX", MiracleGames::Models::AdType::FullScreen));
	initTask.then([](MiracleGames::Services::Core::Common::AsyncProcessResult^ result)
	{
		if (result->ReturnValue)//When the advertisement is closed, the advertisement closing event is triggered and MgAd_AdClosed is executed or do not register the event.
		{
	
		}
	});
	return "";
}
FullScreenInterstitial

public async void ShowFullScreenInterstitialAd()
{
	//“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。	
	var fiAd = await AdvertisingManager.ShowAd(“XXXXXXXX”,AdType.FullScreenInterstitial);
	if (fiAd.ReturnValue)//When the advertisement is closed, the advertisement closing event is triggered and MgAd_AdClosed is executed or do not register the event.
	{
		
	}

}



Platform::String^ MainPage::MainScreen_FullScreenAd()
{
	//“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。
	auto initTask = Concurrency::create_task(MiracleGames::AdvertisingManager::ShowAd("XXXXXXXX", MiracleGames::Models::AdType::FullScreenInterstitial));
	initTask.then([](MiracleGames::Services::Core::Common::AsyncProcessResult^ result)
	{
		if (result->ReturnValue)//When the advertisement is closed, the advertisement closing event is triggered and MgAd_AdClosed is executed or do not register the event.
		{
	
		}
	});
	return "";
}
Exit

 //“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。	
 MiracleGames.AdvertisingManager.SetupExitAdUnitId(“XXXXXXXX”);


Platform::String ^ MainPage::MainScreen_QuitAd()
{
	Windows::UI::Core::CoreWindow^ wnd = Windows::ApplicationModel::Core::CoreApplication::MainView->CoreWindow;

	wnd->Dispatcher->RunAsync(
		Windows::UI::Core::CoreDispatcherPriority::Normal,
		ref new Windows::UI::Core::DispatchedHandler([]()
	{
		//“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。	
		MiracleGames::AdvertisingManager::SetupExitAdUnitId(“XXXXXXXX”);

	}));

	return "";
}
Banner

public async void ShowBannerAdWithClose()
{
   //“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。	
	var bannerAd = await AdvertisingManager.ShowAd(“XXXXXXXX”, AdType.Banner, new BannerAdSettingOptions
	{
		DisplayCloseButton = true,//Whether to turn on the close button
		//Control the placement of display ads
		HorizontalAlignment = HorizontalAlignment.Center,
		VerticalAlignment = VerticalAlignment.Bottom
		
	});

	if (bannerAd.ReturnValue)//When the advertisement is closed, the advertisement closing event is triggered and MgAd_AdClosed is executed or do not register the event.
	{

	}
}


Platform::String ^MainPage::MainScreen_Binner()
{

	auto opt = ref new MiracleGames::Models::BannerAdSettingOptions();
	opt->DisplayCloseButton = true;//Whether to turn on the close button
	//Control the placement of display ads
	opt->HorizontalAlignment = Windows::UI::Xaml::HorizontalAlignment::Center;
	opt->VerticalAlignment = Windows::UI::Xaml::VerticalAlignment::Bottom;
	//“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。	
	auto initTask = Concurrency::create_task(MiracleGames::AdvertisingManager::ShowAd(“XXXXXXXX”, MiracleGames::Models::AdType::Banner, opt));
	initTask.then([](MiracleGames::Services::Core::Common::AsyncProcessResult^ result)
	{
		if (result->ReturnValue)//When the advertisement is closed, the advertisement closing event is triggered and MgAd_AdClosed is executed or do not register the event.
		{
	
		}
	});

	return "";
}

Insertion


public async void ShowInterstitialAdWithClose()
{
	//“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。	
	var interstitialAd = await AdvertisingManager.ShowAd(“XXXXXXXX”,AdType.Interstitial,
		new InterstitialAdSettingOptions { DisplayCloseButton = true });//Whether to turn on the close button
	if (interstitialAd.ReturnValue)//When the advertisement is closed, the advertisement closing event is triggered and MgAd_AdClosed is executed or do not register the event.
	{
   
	}
}


Platform::String^ MainPage::MainScreen_TableAD()
{
	auto opt = ref new MiracleGames::Models::InterstitialAdSettingOptions();
	opt->DisplayCloseButton = true;//Whether to turn on the close button
	//“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。	
	auto initTask = Concurrency::create_task(MiracleGames::AdvertisingManager::ShowAd(“XXXXXXXX”, MiracleGames::Models::AdType::Interstitial, opt));
	initTask.then([](MiracleGames::Services::Core::Common::AsyncProcessResult^ result)
	{
		if (result->ReturnValue)//When the advertisement is closed, the advertisement closing event is triggered and MgAd_AdClosed is executed or do not register the event.
		{
	
		}
	});

	return "";
}
Couplets

 
public async void ShowCoupletAdWithClose()
{
    //“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。	
	var coupletAd = await AdvertisingManager.ShowAd(“XXXXXXXX”,
		AdType.Couplet,
		new CoupletAdSettingOptions
		{
			DisplayCloseButton = true,//Whether to turn on the close button
			VerticalAlignment = VerticalAlignment.Top,//Control the placement of display ads
			CoupletDisplayMode = CoupletDisplayMode.Both//The number of coupletAD Both:Couplet ads on both sides。LeftOnly:Onlyleft。RightOnly:OnlyRight
		});


	if (coupletAd.ReturnValue)//When the advertisement is closed, the advertisement closing event is triggered and MgAd_AdClosed is executed or do not register the event.
	{

	}
}


Platform::String ^ ::MainPage::MainScreen_Couplet()
{
	auto opt = ref new MiracleGames::Models::CoupletAdSettingOptions();
	opt->DisplayCloseButton = true;//Whether to turn on the close button
	opt->VerticalAlignment = Windows::UI::Xaml::VerticalAlignment::Top;//Control the placement of display ads
	opt->CoupletDisplayMode = MiracleGames::Models::CoupletDisplayMode::RightOnly;//The number of coupletAD Both:Couplet ads on both sides。LeftOnly:Onlyleft。RightOnly:OnlyRight
	//“XXXXXXXX”Pparameter needs to pass in the advertisement key, which is created by the MG console. 	。	
	auto initTask = Concurrency::create_task(MiracleGames::AdvertisingManager::ShowAd(“XXXXXXXX”, MiracleGames::Models::AdType::Couplet, opt));
	initTask.then([](MiracleGames::Services::Core::Common::AsyncProcessResult^ result)
	{
		if (result->ReturnValue)//When the advertisement is closed, the advertisement closing event is triggered and MgAd_AdClosed is executed or do not register the event.
		{
	
		}
	});

	return "";
}

Advertising report and payment settings

Report: you can view the advertisement data of the application

Setting - financial information

Financial information: fill in the financial information of individual or enterprise.