UWP SDK好评 更新时间:2021-08-10
简介
本文介绍了如何对接Miracle Games SDK的好评接口,打开微软商店的评价窗口。
判断玩家是否进行过好评(用户登录后调用)
public async void isRatingReview()
{
if (!MiracleGames.ApplicationManager.SetupCompletedSuccessfully)
return;
var result = await MiracleGames.ApplicationManager.IsRatingReviewedAsync();
if (result.ReturnValue)
//result.ReturnValue==true:该用户已进行过好评
//result.ReturnValue==false:该用户未进行好评
}
Platform::String^ MainPage::isRatingReview()
{
concurrency::create_task(MiracleGames::ApplicationManager::IsRatingReviewedAsync())
.then([](MiracleGames::Services::Core::Common::AsyncProcessResult^ result)
{
if (result->ReturnValue)
{
// "该用户已进行过好评"
}
else
{
//"该用户未进行好评"
}
});
}
好评
打开好评窗口
MiracleGames.ApplicationManager.ShowRatingReviewAsync();
MiracleGames::ApplicationManager::ShowRatingReviewAsync();
接收好评结果
var result = await MiracleGames.ApplicationManager.ShowRatingReviewAsync();
if (result.ReturnValue)
{
//用户已完成好评操作
}
concurrency::create_task(MiracleGames::ApplicationManager::ShowRatingReviewAsync()).then([this](MiracleGames::Services::Core::Common::AsyncProcessResult^ result)
{
if (result->ReturnValue)
{
//returnValue是true则点评成功,其余状况是点评失败或已经点评过
}
});