Social ServiceUpdate Time: 2021-03-10
Social Access
The premise of the social function is that the account must be successfully logged in, so first access the login panel.
public MainPage()
{
this.InitializeComponent();
Loaded += (sender, args) =>
{
var auth = await MiracleGames.AuthenticationManager.AuthenticateAsync();//Open the login
if (auth.ReturnValue)//Success of landing
{
//var uid = MiracleGames.AuthenticationManager.UserInfo.Id;
//var token = MiracleGames.AuthenticationManager.UserInfo.Token;
//Show user center bubble.
MiracleGames.BubbleManager.ShowBubble();//Enable community functions
}
};
}
concurrency::create_task(MiracleGames::AuthenticationManager::AuthenticateAsync()).then([this](MiracleGames::Services::Core::Common::AsyncProcessResult^ auth)//Open the login
{
if (!auth->ReturnValue)//Success of landing
return;
//auto uid = MiracleGames::AuthenticationManager::UserInfo.Id;
//auto token = MiracleGames::AuthenticationManager::UserInfo.Token;
//Show user center bubble.
MiracleGames::BubbleManager::ShowBubble();//Enable community functions
});
Community and scorewall event callbacks
Community and integral wall event callback function, can be directly registered in the program to achieve the delegate events。
MiracleGames.BubbleManager.BubbleIntegralWallRewardsChanged += BubbleManager_BubbleIntegralWallRewardsChanged;//Occured when the app installation task has been finished.
private void BubbleManager_BubbleIntegralWallRewardsChanged(object sender, string e)
{
throw new NotImplementedException();
}
MiracleGames.BubbleManager.BubbleIntegralWallFirePwChangeEvents += BubbleManager_BubbleIntegralWallFirePwChangeEvents;//Occured when server send rewards for the installation app task.
private void BubbleManager_BubbleIntegralWallFirePwChangeEvents(object sender, string e)
{
throw new NotImplementedException();
}
MiracleGames.BubbleManager.BubbleOpenCloseEvent += BubbleManager_BubbleOpenCloseEvent;//Occured when the bubble is open or close, paramenter true for open and false for close.
private void BubbleManager_BubbleOpenCloseEvent(object sender, bool e)
{
ShowFullScreenInterstitialAd();
throw new NotImplementedException();
}
MiracleGames::BubbleManager::BubbleIntegralWallRewardsChanged += ref new Windows::Foundation::EventHandler(this, &App::OnBubbleIntegralWallRewardsChanged);
void Snow_Patrol::App::OnBubbleIntegralWallRewardsChanged(Platform::Object ^ sender, Platform::String ^ args)//Occured when the app installation task has been finished.
{
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)//Occured when server send rewards for the installation app task.
{
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)//Occured when the bubble is open or close, paramenter true for open and false for close.
{
throw ref new Platform::NotImplementedException();
}
MG background control whether to enable social function
In application management, add this string |OpenCsd|, and select which function module to enable the corresponding function.