3

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();
    }
  1. 私がしなければならないのはこれだけですか?
  2. ユーザーがアプリを購入すると、IsTrial は自動的に false に設定されますか?
  3. アプリの Identifier がわからない場合、ContentIdentifier を変更するにはどうすればよいですか?
  4. アプリをストアに入れる前に 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();

    }
4

1 に答える 1

3

2番目の質問について。

はい、Microsoft はユーザー アクションに基づいてLicenseInformation.IsTrial値を設定します。ユーザーがアプリを購入すると、IsTrialは false に設定されます。

ストアに送信する前に、すべての購入シナリオをテストする必要があります。CurrentAppSimulator クラスでテストします。これは、ローカルの XML ファイルと連携して機能します。各シナリオのシミュレートされたライセンス情報を XML ファイルに入力します。

質問 3 については、GUID を指定する必要はありません。ContentIdentifier を null のままにしておくと、OS がアプリの GUID を検索します。

于 2013-04-18T19:52:39.270 に答える