The trial mode
So you want to sell your game upfront, but also want to give players a taste of the game so that they can be encouraged to buy your game instead of ignoring it. This can be accomplished using the Trial mode flag provided by the Windows Store API in WinRT.
Even if you want to offer your full game as a time-limited trial using the built-in functionality in the store, you might still want to add in some screens or messages to encourage the player to buy the game. For that, you need to know if the game is a trial, or if the player has purchased it.
This can be easily accessed using the following lines:
auto trial = Windows::ApplicationModel::Store::CurrentApp->LicenseInformation->IsTrial; auto trialActive = Windows::ApplicationModel::Store::CurrentApp->LicenseInformation->IsActive; if (trial && trialActive) // We are in trial mode and it hasn't expired
You'll notice here that we retrieve the IsTrial
flag as well as the IsActive
flag. The IsTrial
flag just...