收据中的iOS IAP in_app字段 [英] iOS IAP in_app field in receipt

查看:163
本文介绍了收据中的iOS IAP in_app字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

收据中有一个in_app字段作为数组.

There's an in_app field as an array in a receipt.

何时返回包含多个元素的数组?

When does it return an array containing more than 1 element?

最新购买的商品的索引是什么?

And what's the index of the latest purchased item?

推荐答案

来自文档

in_app :

在JSON文件中,此键的值是一个数组,其中包含基于输入的base-64收据数据中存在的应用程序内购买交易的所有应用程序内购买收据.对于包含自动续订订阅的收据,请检查last_receipt_info键的值以获取最新续订的状态.

In the JSON file, the value of this key is an array containing all in-app purchase receipts based on the in-app purchase transactions present in the input base-64 receipt-data. For receipts containing auto-renewable subscriptions, check the value of the latest_receipt_info key to get the status of the most recent renewal.

不可消费产品,自动更新订阅,不可更新订阅或免费订阅的应用内购买收据会无限期保留在收据中.

The in-app purchase receipt for a non-consumable product, auto-renewable subscription, non-renewing subscription, or free subscription remains in the receipt indefinitely.

因此,如果您具有自动续订的订阅,或者用户购买了多个非消耗性或非续订的订阅项目,则可以预期此阵列会随着时间的推移而增长.

So, if you have auto-renewing subscriptions or the user purchases multiple non-consumable or non-renewing subscription items you can expect this array to grow over time.

对于自动续订,最新续订的详细信息位于 latest_receipt_info 键中.

For auto-renewing subscriptions, the details of the most recent renewal is in the latest_receipt_info key.

尽管没有记录,但从观察来看,数组中的最后一项似乎是最近购买的商品,但是您应该检查 purchase_date 字段以确保正确.

Although it isn't documented, from observation it seems that the last item in the array is the most recent purchase, but you should check the purchase_date field to be sure.

这篇关于收据中的iOS IAP in_app字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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