Windows Phone 8 アプリといくつかの追加機能がありますが、これらはフル バージョンでしか使用できません。
したがって、ユーザーはボタンをクリックします
if ((Application.Current as App).IsTrial)
{
Buy()
}
else
{
//full feature
}
private void Buy()
{
MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();
marketplaceDetailTask.ContentType = MarketplaceContentType.Applications;
marketplaceDetailTask.ContentIdentifier = "82a23635-5bd9-df11-a844-00237de2db9e";
marketplaceDetailTask.Show();
}
- 私がしなければならないのはこれだけですか?
- ユーザーがアプリを購入すると、IsTrial は自動的に false に設定されますか?
- アプリの Identifier がわからない場合、ContentIdentifier を変更するにはどうすればよいですか?
- アプリをストアに入れる前に ContentIdentifier を変更できますか?
App.xaml
/// <summary>
/// The LicenseInformation class enables an application to determine
/// if it is running under a trial license.
/// </summary>
private static LicenseInformation _licenseInfo = new LicenseInformation();
/// <summary>
/// This property is used to cache the license information while the application is running.
/// The application uses the property whenever the current license information needs to be checked.
/// </summary>
private static bool _isTrial = true;
public bool IsTrial
{
get
{
return _isTrial;
}
}
/// <summary>
/// Check the current license information for this application
/// </summary>
private void CheckLicense()
{
_isTrial = _licenseInfo.IsTrial();
}