UWP SDK Community

Introduction

This article describes how to interface with the Miracle Games SDK's community interface

This interface is managed by MiracleGames, if you need to open the community function, you need to contact MG staff in advance to help open!

Community Function Access

The premise of the community function is that the account must be logged in successfully, so it is usually in the logic of logging in successfully that the social function call code is added.

C#CPP

public MainPage()
{
    this.InitializeComponent();
	try
	{
		Loaded += (sender, args) =>
		{
			 var auth = await MiracleGames.AuthenticationManager.AuthenticateAsync();//enable login
			 if (auth.ReturnValue)//Login successful..
			 {
				 //var uid =  MiracleGames.AuthenticationManager.UserInfo.Id;
				 //var token =  MiracleGames.AuthenticationManager.UserInfo.Token;
				 
				 //Show user center bubble.
				 MiracleGames.BubbleManager.ShowBubble();//Enable community function
			 }
		};
	}
	catch (Exception){}//Implement exception handling to prevent game crashes.
}

try
{
	concurrency::create_task(MiracleGames::AuthenticationManager::AuthenticateAsync()).then([this](MiracleGames::Services::Core::Common::AsyncProcessResult^ auth)//开启登录
	{
		if (!auth->ReturnValue)//Login successful..
			return;
		//auto uid =  MiracleGames::AuthenticationManager::UserInfo.Id;
		//auto token =  MiracleGames::AuthenticationManager::UserInfo.Token;

		//Show user center bubble.
		MiracleGames::BubbleManager::ShowBubble();//Enable community function
	});
}
catch (...){}//Implement exception handling to prevent game crashes.

Community and Scorewall Event Callbacks

The event callback functionality of the Community and Scorewall can be achieved by registering delegated events directly in the application.

C#CPP

try
{
	MiracleGames.BubbleManager.BubbleIntegralWallRewardsChanged += BubbleManager_BubbleIntegralWallRewardsChanged;//Wall of Points app install reward callbacks
	private void BubbleManager_BubbleIntegralWallRewardsChanged(object sender, string e)
	{
		throw new NotImplementedException();
	}

	MiracleGames.BubbleManager.BubbleIntegralWallFirePwChangeEvents += BubbleManager_BubbleIntegralWallFirePwChangeEvents;//Wall of Points Task Completion Reward Callbacks
	private void BubbleManager_BubbleIntegralWallFirePwChangeEvents(object sender, string e)
	{
		throw new NotImplementedException();
	}

	MiracleGames.BubbleManager.BubbleOpenCloseEvent += BubbleManager_BubbleOpenCloseEvent;//bubble open close callbacks
	private void BubbleManager_BubbleOpenCloseEvent(object sender, bool e)
	{
		ShowFullScreenInterstitialAd();
		throw new NotImplementedException();
	}
}
catch (Exception){}//Implement exception handling to prevent game crashes.

try
{
	MiracleGames::BubbleManager::BubbleIntegralWallRewardsChanged += ref new Windows::Foundation::EventHandler(this, &App::OnBubbleIntegralWallRewardsChanged);
	void Snow_Patrol::App::OnBubbleIntegralWallRewardsChanged(Platform::Object ^ sender, Platform::String ^ args)//Wall of Points app install reward callbacks
	{
		throw ref new Platform::NotImplementedException();
	}

	MiracleGames::BubbleManager::BubbleIntegralWallFirePwChangeEvents += ref new Windows::Foundation::EventHandler(this, &App::BubbleIntegralWallFirePwChangeEvents);
	void Snow_Patrol::App::BubbleIntegralWallFirePwChangeEvents(Platform::Object ^ sender, Platform::String ^ args)///Wall of Points Task Completion Reward Callbacks
	{
		throw ref new Platform::NotImplementedException();
	}

	MiracleGames::BubbleManager::BubbleOpenCloseEvent += ref new Windows::Foundation::EventHandler(this, &Snow_Patrol::App::BubbleOpenCloseEvent);
	void Snow_Patrol::App::BubbleOpenCloseEvent(Platform::Object ^ sender, bool args)///bubble open close callbacks
	{
		throw ref new Platform::NotImplementedException();
	}
}
catch (...){}//Implement exception handling to prevent game crashes.

MiracleGames Developer Backend Control Community Functional Module

In Application Management, which function module is ticked below to enable the corresponding function [Reference]