收据中有一个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
发布评论