Skip to main content

SDK Initialization

Introduction

Before integrating the MG Ads SDK, it is necessary to first perform SDK initialization and CMP calls. Only after initialization is completed can the full functionality of this SDK be used in coordination with the backend system. The SDK initialization should be performed immediately upon entering the game.

SDK Initialization

using MiracleGamesAd;
using MiracleGamesAd.Models;

private async void MainPage_Loaded(object sender, RoutedEventArgs e)
{
//CMP
ApplicationManager.OpenCmp("YOUR_APP_KEY","YOUR_Secret_Key");
// Initialization interface call. Required parameters are applied for and created in the MG Ads backend.
var result = await ApplicationManager.Initialize("YOUR_APP_KEY", "YOUR_Secret_Key");
if (result.ReturnValue) // Initialization callback interface to check if initialization is complete.
{

}
}

Possible Errors if Initialization Fails

● Network failure, no proper network support

● UWP applications do not support VPN, and VPN software is enabled on the local machine.

● Incorrect AppId. Please check the application settings in the developer backend.

● Server issues. Please check the error message in the result and promptly contact technical support.