1

我无法找到用户订阅的项目的移动操作系统。我要做的是只允许订阅升级/降级到相同的操作系统。(不允许将每月订阅从 ios 更改为从 android 订阅)

为了解释当前的设置,我将相同的 ID 映射到一个产品。

[offering: monthly]
ios: com.blah.products.monthly
android: com.blah.products.monthly

但是,这种方法似乎无法知道用户订阅了哪个操作系统订阅项。

响应数据:

{
    "allExpirationDates": {
      "com.blah.products.monthly": "2019-04-25T05:07:02Z",
      "com.blah.products.yearly": "2019-04-25T08:07:02Z"
    },
    "activeEntitlements": [
      "premium"
    ],
    "activeSubscriptions": [
      "com.blah.products.yearly"
    ],
    "expirationsForActiveEntitlements": {
      "premium": "2019-04-25T08:07:02Z"
    },
    "latestExpirationDate": "2019-04-25T08:07:02Z",
    "purchaseDatesForActiveEntitlements": {
      "premium": "2019-04-25T07:07:02Z"
    },
    "allPurchasedProductIdentifiers": [
      "com.blah.products.monthly",
      "com.blah.products.yearly"
    ]
  }

为了实现我的目标,我是否必须更改策略以将不同的身份映射到这样的一个产品?

[offering: monthly]
ios: com.something.ios.monthly
android: com.something.android.monthly
4

1 回答 1

1

API 或 SDK 中尚未返回操作系统。一种解决方法可能是更改 App Store Connect 与 Play Billing 中的产品 ID,这样您就可以通过查看产品 ID 来判断用户的计费来源。

对此的真正解决方案是在公共路线图的“计划”阶段,其中将在GET /subscribers端点中包含更多信息:https ://trello.com/c/ialNFe86/50-add-additional-subscription-details-to- api

于 2019-05-01T17:14:15.527 回答