The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
How to switch from Trial to In App Purchases in UWP? RRS feed

  • Question

  • My app has currently only Trial and Full License. I want to remove having trial and make the app free but handle full license features with in app purchases and as well having some other in app purchases. That means I created an in app purchase called "full version" and i want user to buy this in order to access all features of the app. 
    I decided to create a durable in app purchase as "full version" to handle it myself. My Question here is I have already people purchased full version of the app using trial/full version handled by Microsoft Store. 
    How can I get that information and give users who already purchased the full version?
    Monday, November 18, 2019 12:06 PM

All replies

  • Hi,

    If you want to know the user has purchased the specified add-on, you can use the following code:

    var context = StoreContext.GetDefault();
    string[] productKinds = { "Durable" };
    List<String> filterList = new List<string>(productKinds);
    StoreProductQueryResult queryResult = await context.GetUserCollectionAsync(filterList);
    
    if (queryResult.ExtendedError != null)
    {
        // The user may be offline or there might be some other server failure.
    }
    
    foreach (KeyValuePair<string, StoreProduct> item in queryResult.Products)
    {
        StoreProduct product = item.Value;
    
        // Use members of the product object to access info for the product...
    }

    In fact, you can know a lot of information through the StoreContext, the specific content can refer to this document.

    By the way, We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A (Preview)!

    Best regards.


    "Developing Universal Windows apps" forum will be migrating to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.



    Monday, November 18, 2019 12:37 PM
  • Hi,

    Does my reply solve your problem? Do you have any other questions you want to clarify?

    The UWP section of MSDN is about to be locked down. If you have other questions, please come to Microsoft Q&A to ask questions, and we will continue to answer your questions there.

    Best regards.


    "Developing Universal Windows apps" forum will be migrating to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.

    Tuesday, December 3, 2019 8:09 AM
  • Hi,

    Sorry to disturb you again, we are confirming the status of the question. Did my response resolve your issue?

    Since the UWP section of the MSDN Forum will be locked down in the near future, after that, if you have new questions, welcome to our new community: Microsoft Q&A, where we will continue to answer your questions.

    Best regards.


    "Developing Universal Windows apps" forum will be migrating to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.

    Friday, December 6, 2019 6:24 AM
  • Hi,

    Sorry to disturb you again, did you solve your problem?

    Since the UWP section of the MSDN Forum will be locked down in the near future, after that, if you have new questions, welcome to our new community: Microsoft Q&A, where we will continue to answer your questions.

    Best regards.


    "Developing Universal Windows apps" forum will be migrating to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.

    Wednesday, December 11, 2019 8:08 AM