3

I found this handy piece of code to determine if my app is in trial mode, with the added benefit of being able to test trial behavior in the emulator...

public bool IsTrial
{
    get
    {
        #if DEBUG
        return true;
        #endif

        return new LicenseInformation().IsTrial();
    }
} 

And that's great. I'll be able to adjust behavior accordingly.

But beyond that, I was hoping for some built-in API where I can actually get a dialog box with a button to buy the app. Ideally, the button should take the user directly to the app in the marketplace.

Steve Wortham
  • 21,740
  • 5
  • 68
  • 90
  • 1
    Calling `LicenseInformation().IsTrial();` can be quite slow. If you're going to query this a lot you should cache the result. – Matt Lacey Dec 09 '10 at 19:26
  • Yeah, as Matt said, IsTrial() can be really slow on the phone, but is fast on the emulator, so don't check it in a tight loop. – Nigel Sampson Dec 09 '10 at 22:55

1 Answers1

6

The presentation of the upsell dialog is up to the app developer for the simple reason that it has to blend seamlessly into the app design and user experience.

So, present the user with whatever UI elements you want, and once she clicks on it, sending her to the marketplace using the MarketplaceDetailTask.

Franci Penov
  • 74,861
  • 18
  • 132
  • 169
  • 1
    Thanks Franci, I found the MarketplaceDetailTask just as you posted your answer. This is apparently all the code it takes... `var mdt = new MarketplaceDetailTask(); mdt.Show();` – Steve Wortham Dec 09 '10 at 18:36