开发者

isTrial and the Marketplace for Windows phone 7

I'm trying to wrap up my latest app and I want to make it a Free Trial app.

I've done all my checks to see if it is in trial mode or not and now I'm about to launch the MarketPlace so they can buy it. I have a couple of questions...

In this code below, do I have to pass any sort of ID that my app generates so that it knows where to go in the Marketplace? Or is it all done for me in this call?

MarketplaceDetailTask detailTask = new MarketplaceDetailTask();
detailTask.Show();

My second question is in regards to the tombstoning that will happen when this code gets called and what happens after they buy it? Is there some special event that I should be looking for (like a completed event)? From what I understand I need to recheck the license and I'm just wondering what the best practic开发者_Go百科es are for that.

Just as a reference this is the example I'm currently following: http://msdn.microsoft.com/en-us/library/ff967559%28v=VS.92%29.aspx

Thanks!


1) First Question: if you don't specify the id, WP7 will take the id of the calling app (yours)

2)I have a service in front of the Licence class and when the user goes to the marketplace I reset a field to read again the trial status when ask afterwards (see the buy method below)

public class TrialService : ITrialService
{
    private LicenseInformation license;

    public bool IsTrial()
    {
        if (RunAsTrial)                                
            return true;
        else                                                 
        {
            if (license == null)
                license = new LicenseInformation();
            return license.IsTrial();
        }
    }

    public void Buy()
    {
        license = null;
        var launcher = new MarketplaceDetailTask();
        launcher.Show();
    }

    public bool RunAsTrial { get; set; }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜