Uncategorized

Implement a trial version of your app

If you configure your app as a free trial in Partner Center, allowing customers to use your app for free during a trial period, you can entice your customers to upgrade to the full version of your app by excluding some features during that time or limit the probationary period. Determine which features should be restricted before you start coding, and then make sure your app only allows them if a full license has been purchased. You can also enable features such as banners or watermarks, which are only displayed during the trial before a customer purchases your app.

This article shows how to use members of the StoreContext class in Windows.Services . Store namespace to determine if the user has a trial license for your app and to be notified if the status of the license changes while your app is running.

Reading: How to create a trial for an app

Policies for implementing a trial

The current license status of your app is stored as properties of the StoreAppLicense class. Typically, you put the features that depend on the license status in a conditional block, as we describe in the next step. If you’re considering these features, make sure you can implement them in a way that works in all license states.

Also decide how you want to handle app license changes while the app is running. Your trial app may be fully functional but have in-app ad banners where the paid version doesn’t. Or your test app may disable certain features or show periodic messages prompting the user to buy it.

See also  Dublin City

Think about the type of app you are building and what makes a good test or process strategy for it. For a trial version of a game, a good strategy is to limit the amount of game content that a user can play. For a utility trial, you can set an expiration date or restrict the features a potential buyer can use.

For most non-gaming apps, setting an expiration date works well as users can get a good understanding develop for the whole app. Here are some common expiration scenarios and your options for handling them.

  • See also: Teenager Resume Examples (Also With No Work Experience)

    The trial license will expire while the app is running

    If the trial expires while your app is running, your app can:

    • Do nothing.
    • Display a message to your customer.
    • Close.
    • Prompt your customer to buy the app.

    The best way is to show a message asking them to buy the app and when the customer buys it , proceed to all features enabled. If the user decides not to purchase the app, close it or periodically remind them to purchase the app.

  • The trial license will expire , before the app is launched

    If the trial expires before the user launches the app, your app will not launch. Instead, users see a dialog box that gives them the option to purchase your app from the store.

  • Customer purchases the app while it’s running

    See also: About GitHub Pages

    If the customer buys your app while it’s running, your app can take the following actions.

    • Do nothing and let them continue in trial mode until they buy the app restarts.
    • Thank you for the purchase or display a message.
    • Silently enable the features available with a full license (or disable the trial-only -Notes).
See also  General Resume Examples That Arent Generic: 11 Templates

Be sure to explain how your app will behave during and after the free trial period so that your customers are not surprised by your app’s behavior . For more information on describing your app, see Creating app descriptions.

Prerequisites

This example has the following prerequisites:

  • A Visual Studio project for a Universal Windows Platform (UWP) app targeting Windows 10 Anniversary Edition (10.0; Build 14393) or a later version.
  • You have created an app in Partner Center that is configured as a free trial with no time limit and this app is published in the store. You can optionally configure the app to be undetectable in the store while you’re testing it. For more information, see our testing guide.

The code in this example assumes the following:

  • The code is executed in the context of a page that contains a ProgressRing contains workingProgressRing and a TextBlock called textBlock. These objects are used to indicate that an asynchronous operation is taking place or to display output messages.
  • The code file contains a using statement for the Windows.Services. Store namespace.
  • The app is a single-user app that runs only in the context of the user who launched the app. For more information, see In-app purchases and trials.

Code sample

When your app is initialized, get and process the StoreAppLicense object for your app the OfflineLicensesChanged event to receive notifications when the license changes while the app is running. For example, the app’s license could change when the trial period expires or the customer purchases the app through a store.If the license changes, obtain the new license and enable or disable a feature of your app accordingly.

See also  How to Write a Resume with No Experience: 5 Tips

If a user has purchased the app, it’s a good idea at this point to provide feedback to the user the licensing status has changed. You may have to ask the user to restart the app if you coded it that way. But make this transition as seamless and painless as possible.

private StoreContext context = null; privateStoreAppLicense appLicense = null; // Call this while your app is being initialized. private async void InitializeLicense() { if (context == null) { context = StoreContext.GetDefault(); // If your app is a desktop app using the Desktop Bridge // you may need additional code to configure the StoreContext object. // For more information, see https://aka.ms/storecontext-for-desktop. } workingProgressRing.IsActive = true; appLicense = Wait for context.GetAppLicenseAsync(); workingProgressRing.IsActive = false; // Sign up for the licensed changed event. context.OfflineLicensesChanged = context_OfflineLicensesChanged; } private async void context_OfflineLicensesChanged(StoreContext sender, object args) { // Reload license. workingProgressRing.IsActive = true; appLicense = Wait for context.GetAppLicenseAsync(); workingProgressRing.IsActive = false; if (appLicense.IsActive) { if (appLicense.IsTrial) { textBlock.Text = $”This is the trial version. Expiration Date: {appLicense.ExpirationDate}”; // Displays the features that are only available during the trial period. } else { // Show features that are only available with a full license. } } }

See the store sample for a complete sample application.

See also: Selling Health Insurance: The Definitive Guide

Related Topics

  • In-App Purchases and Trials
  • Get Product information for apps and add-ons
  • Get license information for apps and add-ons
  • Enable in-app purchases of apps and add-ons
  • Enable consumables Add-on Purchases
  • Shop Sample

.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button