Praise System

Introduction

This article introduces how to dock Miracle Games SDK Rate interface and how to open Microsoft Store rate interface.

Determine if the Player Has Rated (call after user login)

UWPCPP

bool isRatingReview=MiracleGames.ApplicationManager.IsRatingReview();
//Return value true=has been commented; false=not commented

bool isRatingReview=MiracleGames::ApplicationManager::IsRatingReview();
//Return value true=has been commented; false=not commented

Rate

Open Rate Window

UWPCPP

MiracleGames.ApplicationManager.ShowRatingReview();

MiracleGames::ApplicationManager::ShowRatingReview();

Receiving Rating Result

Register the praise reception event in app.xmal.cs, this event will be triggered after the player finishes the good comment.

UWPCPP

MiracleGames.ApplicationManager.RatingReviewEvents += ratingReview;

async void ratingReview(object sender, MiracleGames.MiracleGamesEvent.RatingReviewEventArgs args)
{
	//The returned data is a json string. Result=success,userId=userId, appKey=MG application key
	new MessageDialog(args.ToString()).ShowAsync();
}
concurrency::create_task(MiracleGames::ApplicationManager::ShowRatingReviewAsync()).then([this](MiracleGames::Services::Core::Common::AsyncProcessResult^ result)
{
	if (result->ReturnValue)
	{
	  //returnValue==true  The comment is successful, the rest of the situation is the comment failed or has already commented
	}
});