Game Development Reference
In-Depth Information
if
(!license->ProductLicenses->Lookup(transformedId)->IsActive)
{
// Product hasn't been purchased yet
concurrency::task<Platform::String^>
purchaseTask(CurrentApp::RequestProductPurchaseAsync(transformedId,
false));
purchaseTask.wait();
if
(license->ProductLicenses->Lookup(transformedId)->IsActive)
// return indicating success
}
count++;
transformedId = TransformConsumable(identifier,
count);
This block of code handles most of the work. Here we check if the product has been
purchased, and if it hasn't then we can request a purchase. Assuming that succeeds,
then we are done and we don't need to keep looping. If the product has already been
purchased then we increase the index and try again with the new identifier.
Search WWH ::




Custom Search