1. 参考文章
2.C++/CX代码片
我用的是c++,官方文档介绍的是c#的代码。
Windows::ApplicationModel::Core::CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]
{
auto authTask = Concurrency::create_task(StoreRequestHelper::SendRequestAsync(StoreContext::GetDefault(), 16, ""));
authTask.then([=](task<StoreSendRequestResult^>t)
{
StoreSendRequestResult^ result = t.get();
if (!result->ExtendedError.Value)
{
auto jsonObject = JsonObject::Parse(result->Response);
if (jsonObject->GetNamedString("status")->Equals("success"))
{
// The customer rated or reviewed the app.
//ok
}
}
// There was an error with the request, or the customer chose not to
// rate or review the app.
});
}));