订阅到期日

Subscription Expiration Date

我对应用内购买的收据格式有疑问。

主收据对象有一个名为 Subscription Expiration Date 的字段。

但是如果一个应用有多种类型的续订订阅,那么这个字段会反映什么?

它在 documentation 中被称为 Subscription Expiration Date,但是如果您在下面阅读 json 键的实际名称是 expires_date,只是想指出这一点在您进行搜索之前没有在您的应用程序中找到它。

为了回答您的问题,您会在文档中看到,特定键 Subscription Expiration Date 列在名为 In-App Purchase Receipt Fields 的标题下。这意味着,我可以根据自己的经验确认,每次 In-App 单独购买订阅以及每次续订都存在此密钥。这意味着可以进行多次购买,每次购买都作为自己进入 receipt-json 的条目,每次购买都有 expires_date.

如果您想使用该密钥进行验证,收据将包含从苹果服务器发送的请求日期。使用该日期查看其中一个订阅是否仍然是 运行。

希望对您有所帮助。

编辑:这是一个实际解析的定向收据示例。 请注意,为了安全起见,我删除了一些 ID。在这里你会看到一张收据,在顶部你会看到收据的具体信息,然后是一次性购买,然后是每年续订大约 4 次的订阅。

["original_purchase_date_pst": Optional(2013-08-01 00:00:00 
America/Los_Angeles), 
"bundle_id": Optional(yourAppBundleId), 
"receipt_creation_date_pst": Optional(2018-12-20 02:20:38 America/Los_Angeles), 
"receipt_type": Optional(ProductionSandbox), 
"app_item_id": Optional(0), "application_version": Optional(2), 
"request_date_pst": Optional(2018-12-20 02:20:41 America/Los_Angeles), 
"original_purchase_date_ms": Optional(1375340400000), 
"receipt_creation_date_ms": Optional(1545301238000), 
"in_app": Optional(<__NSArrayI 0x283b736b0>(

{
    "is_trial_period" = false;
    "original_purchase_date" = "2018-12-07 12:00:43 Etc/GMT";
    "original_purchase_date_ms" = 1544184043000;
    "original_purchase_date_pst" = "2018-12-07 04:00:43 America/Los_Angeles";
    "original_transaction_id" = XXXXXXXXXXXXX;
    "product_id" = "someSinglePurchase";
    "purchase_date" = "2018-12-07 12:00:43 Etc/GMT";
    "purchase_date_ms" = 1544184043000;
    "purchase_date_pst" = "2018-12-07 04:00:43 America/Los_Angeles";
    quantity = 1;
    "transaction_id" = 10000XXXXXXXXX;
},
{
    "expires_date" = "2018-12-07 13:01:21 Etc/GMT";
    "expires_date_ms" = 1544187681000;
    "expires_date_pst" = "2018-12-07 05:01:21 America/Los_Angeles";
    "is_in_intro_offer_period" = false;
    "is_trial_period" = false;
    "original_purchase_date" = "2018-12-07 12:01:22 Etc/GMT";
    "original_purchase_date_ms" = 1544184082000;
    "original_purchase_date_pst" = "2018-12-07 04:01:22 America/Los_Angeles";
    "original_transaction_id" = 10000XXXXXXXXX;
    "product_id" = "yearlySubscription";
    "purchase_date" = "2018-12-07 12:01:21 Etc/GMT";
    "purchase_date_ms" = 1544184081000;
    "purchase_date_pst" = "2018-12-07 04:01:21 America/Los_Angeles";
    quantity = 1;
    "transaction_id" = 10000XXXXXXXXX;
    "web_order_line_item_id" = 10000XXXXXXXXX;
},
{
    "expires_date" = "2018-12-07 14:01:35 Etc/GMT";
    "expires_date_ms" = 1544191295000;
    "expires_date_pst" = "2018-12-07 06:01:35 America/Los_Angeles";
    "is_in_intro_offer_period" = false;
    "is_trial_period" = false;
    "original_purchase_date" = "2018-12-07 12:01:22 Etc/GMT";
    "original_purchase_date_ms" = 1544184082000;
    "original_purchase_date_pst" = "2018-12-07 04:01:22 America/Los_Angeles";
    "original_transaction_id" = 10000XXXXXXXXX;
    "product_id" = "yearlySubscription";
    "purchase_date" = "2018-12-07 13:01:35 Etc/GMT";
    "purchase_date_ms" = 1544187695000;
    "purchase_date_pst" = "2018-12-07 05:01:35 America/Los_Angeles";
    quantity = 1;
    "transaction_id" = 10000XXXXXXXXX;
    "web_order_line_item_id" = 10000XXXXXXXXX;
},
{
    "expires_date" = "2018-12-07 15:01:35 Etc/GMT";
    "expires_date_ms" = 1544194895000;
    "expires_date_pst" = "2018-12-07 07:01:35 America/Los_Angeles";
    "is_in_intro_offer_period" = false;
    "is_trial_period" = false;
    "original_purchase_date" = "2018-12-07 12:01:22 Etc/GMT";
    "original_purchase_date_ms" = 1544184082000;
    "original_purchase_date_pst" = "2018-12-07 04:01:22 America/Los_Angeles";
    "original_transaction_id" = 10000XXXXXXXXX;
    "product_id" = "yearlySubscription";
    "purchase_date" = "2018-12-07 14:01:35 Etc/GMT";
    "purchase_date_ms" = 1544191295000;
    "purchase_date_pst" = "2018-12-07 06:01:35 America/Los_Angeles";
    quantity = 1;
    "transaction_id" = 10000XXXXXXXXX;
    "web_order_line_item_id" = 10000XXXXXXXXX;
}