Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems while checking if user purchases a subscription: empty array for appLicense.AddOnLicenses, weird extra sku object for product. #2699

Closed
AlexMisiulia opened this issue Sep 14, 2020 · 1 comment
Assignees
Labels
doc-bug feedback is about something that is out of date, unclear, confusing, or broken in the article Pri3

Comments

@AlexMisiulia
Copy link

AlexMisiulia commented Sep 14, 2020

Hi, I'm trying to add subscriptions to my app. And I have problems while checking if the user purchases a subscription. I have 2 problems:

  1. Method CheckIfUserHasSubscriptionAsync() from documentation always return empty array after I bought a subscription (I tested either with and without trial). I can see that product has property "IsInUserCollection":true when calling method GetSubscriptionProductAsync(), but appLicense.AddOnLicenses inside CheckIfUserHasSubscriptionAsync() is always empty.
  2. Method GetSubscriptionProductAsync() returns strange response with 1 extra sku.

In the documentation in the code comment it is written:

// Check if the first SKU is a trial and notify the customer that a trial is available.
// If a trial is available, the Skus array will always have 2 purchasable SKUs and the
// first one is the trial. Otherwise, this array will only have one SKU.

But actually I have always 3 purchasable SKUs after purchasing a product. And weird thing is that SKU that has the property "IsInUserCollection": true doesn't have any SubscriptionInfo:

[
  {
    "StoreId": "9NJJSGSS23P8",
    "IsInUserCollection": true,
    "Title": "1 год подписки",
    "ProductKind": "Durable",
    "Price": {
      "CurrencyCode": "USD",
      "FormattedPrice": "79,99 $",
      "FormattedBasePrice": "79,99 $",
      "FormattedRecurrencePrice": "79,99 $",
      "IsOnSale": false,
      "SaleEndDate": "9998-12-30T03:00:00.0000000"
    },
    "HasDigitalDownload": false,
    "InAppOfferToken": "OneYearSubscriptionWithTrialFinal",
    "Skus": [
      {
        "StoreId": "9NJJSGSS23P8/0100",
        "Title": "1 год подписки",
        "IsInUserCollection": false,
        "IsTrial": false,
        "Price": {
          "CurrencyCode": "USD",
          "FormattedPrice": "79,99 $",
          "FormattedBasePrice": "79,99 $",
          "FormattedRecurrencePrice": "79,99 $",
          "IsOnSale": false,
          "SaleEndDate": "9998-12-30T03:00:00.0000000"
        },
        "CollectionData": null,
        "IsSubscription": true,
        "SubscriptionInfo": {
          "BillingPeriod": 1,
          "BillingPeriodUnit": "Year",
          "HasTrialPeriod": false,
          "TrialPeriod": 0,
          "TrialPeriodUnit": "Week"
        },
        "Language": "ru"
      },
      {
        "StoreId": "9NJJSGSS23P8/0101",
        "Title": "1 год подписки",
        "IsInUserCollection": false,
        "IsTrial": false,
        "Price": {
          "CurrencyCode": "USD",
          "FormattedPrice": "0,00 $",
          "FormattedBasePrice": "0,00 $",
          "FormattedRecurrencePrice": "79,99 $",
          "IsOnSale": false,
          "SaleEndDate": "9998-12-30T03:00:00.0000000"
        },
        "CollectionData": null,
        "IsSubscription": true,
        "SubscriptionInfo": {
          "BillingPeriod": 1,
          "BillingPeriodUnit": "Year",
          "HasTrialPeriod": true,
          "TrialPeriod": 1,
          "TrialPeriodUnit": "Week"
        },
        "Language": "ru"
      },
      {
        "StoreId": "9NJJSGSS23P8/0020",
        "Title": "1 год подписки",
        "IsInUserCollection": true,
        "IsTrial": false,
        "Price": {
          "CurrencyCode": "USD",
          "FormattedPrice": "0,00 $",
          "FormattedBasePrice": "0,00 $",
          "FormattedRecurrencePrice": "0,00 $",
          "IsOnSale": false,
          "SaleEndDate": "9998-12-30T03:00:00.0000000"
        },
        "CollectionData": {
          "CampaignId": "",
          "StartDate": "2020-09-14T03:00:00.0000000",
          "EndDate": "2020-09-24T03:00:00.0000000",
          "AcquiredDate": "2020-09-14T12:26:28.7964538",
          "IsTrial": true,
          "TrialTimeRemaining": "10675199:2:48:05,4775807"
        },
        "IsSubscription": false,
        "SubscriptionInfo": null,
        "Language": "ru"
      }
    ]
  }
]

For the case when a product doesn't have a trial it has 2 skus, but with the same problem as mentioned above:

[
  {
    "StoreId": "9NVCL1M4W3MT",
    "IsInUserCollection": true,
    "Title": "TestSubscription9",
    "ProductKind": "Durable",
    "Price": {
      "CurrencyCode": "USD",
      "FormattedPrice": "0,00 $",
      "FormattedBasePrice": "0,00 $",
      "FormattedRecurrencePrice": "0,00 $",
      "IsOnSale": false,
      "SaleEndDate": "9998-12-30T03:00:00.0000000"
    },
    "HasDigitalDownload": false,
    "InAppOfferToken": "TestSubscription9",
    "Skus": [
      {
        "StoreId": "9NVCL1M4W3MT/0100",
        "Title": "TestSubscription9",
        "IsInUserCollection": false,
        "IsTrial": false,
        "Price": {
          "CurrencyCode": "USD",
          "FormattedPrice": "0,00 $",
          "FormattedBasePrice": "0,00 $",
          "FormattedRecurrencePrice": "0,00 $",
          "IsOnSale": false,
          "SaleEndDate": "9998-12-30T03:00:00.0000000"
        },
        "CollectionData": null,
        "IsSubscription": true,
        "SubscriptionInfo": {
          "BillingPeriod": 1,
          "BillingPeriodUnit": "Month",
          "HasTrialPeriod": false,
          "TrialPeriod": 0,
          "TrialPeriodUnit": "Week"
        },
        "Language": "en"
      },
      {
        "StoreId": "9NVCL1M4W3MT/0020",
        "Title": "TestSubscription9",
        "IsInUserCollection": true,
        "IsTrial": false,
        "Price": {
          "CurrencyCode": "USD",
          "FormattedPrice": "0,00 $",
          "FormattedBasePrice": "0,00 $",
          "FormattedRecurrencePrice": "0,00 $",
          "IsOnSale": false,
          "SaleEndDate": "9998-12-30T03:00:00.0000000"
        },
        "CollectionData": {
          "CampaignId": "",
          "StartDate": "2020-09-14T03:00:00.0000000",
          "EndDate": "2020-10-17T03:00:00.0000000",
          "AcquiredDate": "2020-09-14T12:58:24.8579557",
          "IsTrial": false,
          "TrialTimeRemaining": "10675199:2:48:05,4775807"
        },
        "IsSubscription": false,
        "SubscriptionInfo": null,
        "Language": "en"
      }
    ]
  }
]
@PRMerger8 PRMerger8 added the Pri3 label Sep 14, 2020
@hkhmsft hkhmsft added the doc-bug feedback is about something that is out of date, unclear, confusing, or broken in the article label Sep 16, 2020
QuinnRadich pushed a commit that referenced this issue Jun 13, 2022
@jwmsft jwmsft assigned GrantMeStrength and unassigned hickeys Jan 11, 2024
@GrantMeStrength
Copy link
Contributor

We are changing the way we track issues filed from our documentation pages: please see this blog post for more details. The Microsoft Store documentation has been updated several times since your issue was reported, and there's a good chance your problem has been addressed. Right now, this issue is being closed but if you feel it is still valid and has not been addressed, please re-open it with any more available information. Please note that if you question is more general and not related to documentation, Microsoft Q&A is a great way to get questions answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-bug feedback is about something that is out of date, unclear, confusing, or broken in the article Pri3
Projects
None yet
Development

No branches or pull requests

5 participants