Share via

Does StoreAppLicense.AddOnLicenses return historical add-on licenses or only active ones?

Muhammed Işık 60 Reputation points
2026-03-07T12:16:03.3233333+00:00
StoreAppLicense appLicense = await context.GetAppLicenseAsync(); 
var licenses = appLicense.AddOnLicenses.Values.ToList();

My app offers several subscription products, and a user should only have one active subscription at a time. I want to confirm whether licenses may contain historical subscription licenses (expired or cancelled) that I need to filter out, or if it only includes the currently active licenses.

Also, the StoreLicense object contains the IsActive property, but the documentation states:

This property is reserved for future use, and it is not intended to be used in the current release. Currently, it always returns true.

Given this, what is the recommended way to determine the currently active subscription?

Windows development | Windows App SDK
0 comments No comments

Answer accepted by question author
  1. Jack Dang (WICLOUD CORPORATION) 16,595 Reputation points Microsoft External Staff Moderator
    2026-03-09T04:46:56.59+00:00

    Hi @Muhammed Işık ,

    Thanks for reaching out.

    When you call GetAppLicenseAsync() and check StoreAppLicense.AddOnLicenses, the collection represents the add-on licenses that are currently valid for the user. In other words, it typically contains the entitlements that the user can actively use. Expired or cancelled subscriptions are generally not included in this collection.

    Because of that behavior, one possible approach to determining whether a subscription is active is to check whether the corresponding add-on ID exists in AddOnLicenses. If the add-on appears in the collection, it would normally indicate that the Store currently considers that entitlement valid for the user.

    One small thing to keep in mind is that license information can occasionally be cached locally by the Store. For example, right after a purchase or when a device has been offline, the license state might take a short moment to sync. In those cases, calling GetAppLicenseAsync() again after the Store refreshes the license data may help ensure you are working with the most up-to-date license information.

    So one way you might structure the check is:

    • Call GetAppLicenseAsync()
    • Check whether your subscription add-on ID exists in AddOnLicenses
    • If it appears in the collection, treat the subscription as currently active

    If you found my response helpful or informative in any way, I would greatly appreciate it if you could follow this guidance provide feedback. 

    Thank you.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-03-07T12:16:15.4533333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    StoreAppLicense.AddOnLicenses returns only currently valid durable add-on licenses, not historical ones. Expired or otherwise invalid licenses are removed from this collection.

    From the documentation for StoreAppLicense.AddOnLicenses and StoreLicense:

    • StoreAppLicense.AddOnLicenses:

      This collection contains durable add-on licenses that are currently valid. When a license is expired or no longer valid, it will no longer be available in this collection.

    • StoreLicense (obtained via AddOnLicenses):

      This property contains only the add-on licenses that are still valid and provide the current user with an entitlement to use the add-on. When an add-on license expires or is longer valid, it will no longer be available in the StoreAppLicense.AddOnLicenses collection.

    Therefore:

    • The licenses list in the sample code
        StoreAppLicense appLicense = await context.GetAppLicenseAsync(); 
        var licenses = appLicense.AddOnLicenses.Values.ToList();
      
      will contain only active/valid entitlements for durable add-ons.
    • Historical (expired, cancelled, or otherwise invalid) subscription licenses will not appear in AddOnLicenses.

    Regarding StoreLicense.IsActive being reserved and always returning true in the current release: the recommended way to determine which subscriptions are currently active is to rely on presence in StoreAppLicense.AddOnLicenses as the indicator of an active entitlement. If a subscription add-on is not in this collection, it should be treated as inactive/expired for that user.

    For a full picture of the app’s license state (including whether the app license itself is active), use StoreContext.GetAppLicenseAsync() and the StoreAppLicense.IsActive property:

    The StoreAppLicense object returned by this method provides access to licenses for add-ons and other info, such as whether the license is active.

    In summary, to determine the currently active subscription:

    1. Call GetAppLicenseAsync() to get StoreAppLicense.
    2. Use StoreAppLicense.AddOnLicenses as the set of currently active durable add-on subscriptions.
    3. Apply app-specific logic (e.g., if more than one subscription is present, choose the highest tier or latest purchase) on that active set; no extra filtering for expired/cancelled items is required because they are not included.

    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.