对 Microsoft Store API 的请求总是返回空的产品/订阅列表 [英] Requests to Microsoft Store APIs always return empty lists of products / subscriptions

查看:23
本文介绍了对 Microsoft Store API 的请求总是返回空的产品/订阅列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将免费的 UWP 应用发布到 Microsoft Store,其中包含非消耗品升级加载项.由于新的订阅计费模型是

以下是您需要做的:

  1. 如果您很久以前提交了一个非消耗性耐用附加组件,您需要创建一个新提交,选择上述问题的任何答案并将其提交给认证.一旦您的产品更新版本在商店中,请尝试请求用户收集产品 - 现在应该将其包含在响应中.
  2. 如果您创建了订阅附加组件,您似乎必须对问题选择是"并提供隐私政策 URL,否则它将永远不会出现在订阅一个用户".另请注意,根据我们的经验,与非消耗性耐用产品相比,生效需要更长的时间 - 认证完成后最多需要 24 小时左右.

好的,现在好了,但我就是不明白为什么微软没有直接在文档中提到这些要求,导致在沮丧中迷失了很多天......

We have free UWP app published to the Microsoft Store with non-consumable upgrade add-ons. As new subscription billing model was introduced to public audience recently, we're planning to utilise it by adding subscription plans in the next release.

We also would like to view and manage user-owned add-ons on our backend, and there's relevant documentation to do just that. We followed it closely, but in the end — while trying to get subscriptions for a user, for example — we always get an empty response: { "items": [] }.

Here is what we did briefly, step by step:

  1. Created new app registration in Azure Active Directory.
  2. Associated app registration's identifier with our app through Partner Dashboard.
  3. Created three Azure Active Directory (AAD) tokens for following audience URIs:

  4. Created Microsoft Store ID keys for Collection and Purchase APIs on behalf of our test Microsoft account by calling StoreContext.GetCustomerCollectionsIdAsync and StoreContext.GetCustomerPurchaseIdAsync respectively from client code in our app. To generate each key we used corresponding AAD token from step 3.

  5. Requested products / subscriptions for the user (using authorization AAD token from step 3 and Store ID keys from step 4).

So we're getting 200 "OK" response, but the list is always empty and that is very disappointing and actually a major blocking issue right now for us.

We also can confirm via "Order History" that our aforementioned test Microsoft account owns at least one durable add-on and one subscription. The same result can be checked by calling StoreContext.GetUserCollectionAsync or StoreContext.GetAppLicenseAsync API in the client app — there are one non-consumable product and one subscription indeed.

I posted same question on the official forum, but not sure if we'll get a reply soon, so decided to post it here as well. Note, that similar question is also posted on the forums, but it's not quite clear from the thread whether it was resolved or not.

Has anyone managed to get user purchases from the their backend service? We'll appreciate any guidance, that could make it working for us too.

UPDATE (2018.08.29):

So we have a little bit of progress with the issue. We created new non-free ($0.99) subscription add-on, purchased it and requested subscriptions for a user. Surprisingly enough, a new item appeared in the response!

It's worth to mention that same user already owned several subscriptions that were free of charge, but none of them are on list in the response. And I have never seen a mention in documentation about any restrictions for free subscriptions, saying that they won't be included in returned items.

Anyway, the problem with subscriptions being partially solved, now we can't get info about any non-consumable durable add-on with "Query for products" API, regardless of its price tier — that's also a major problem, so further investigation is needed.

解决方案

Finally it seems that we resolved the issue!

There're slightly different scenarios for non-consumable durable products and subscriptions, but they're all related to a new required question about personal data collection in add-on properties, which looks like this:

Here are what you need to do:

  1. If you had a non-consumable durable add-on submitted quite a while ago, you need to create a new submission, choose any answer to the aforementioned question and submit it to certification. Once your updated version of product is in the store, try to request user collection of products — it should be included in response now.
  2. If you create a subscription add-on, it looks like you must select "Yes" to the question and provide a privacy policy URL, otherwise it will never appear in the response to "Subscriptions for a user". Also note that based on our experience, it will take longer to take effect compared to non-consumable durable products — up to 24 hours or so after certification finished.

Ok, now it's fine, but I just can't understand why these requirements weren't mentioned by Microsoft straight away in the documentation, leading to many days lost in frustration…

这篇关于对 Microsoft Store API 的请求总是返回空的产品/订阅列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆