gpt4 book ai didi

swift - 使用可信服务器验证 IAP 收据。如果返回的 JSON 不包含 "latest_receipt_info" key ,如何确定试用资格?

转载 作者:行者123 更新时间:2023-11-30 10:49:45 25 4
gpt4 key购买 nike

我正在开发一个 iOS swift 应用程序,该应用程序使用应用程序内购买进行单个自动续订订阅,并有 1 周的免费试用期。为了确定试用资格,我正在阅读文档 here 。它说:

Determine Eligibility

To determine if a user is eligible for anintroductory price, check their receipt: Validate the receipt asdescribed in Validating Receipts With the App Store. In the receipt,check the values of the Subscription Trial Period and the SubscriptionIntroductory Price Period for all in-app purchase transactions. Ifeither of these fields are true for a given subscription, the user isnot eligible for an introductory price on that subscription product orany other products within the same subscription group. You typicallycheck the user's eligibility from your server. It's best to determineeligibility early—for example, on the first launch of the app, ifpossible.

Based on the receipt, you will find that new and returning customersare eligible for introductory price or free trial discounts asfollows: New subscribers are always eligible. Lapsed subscribers whorenew are eligible if they haven't previously received an introductoryprice for the given product (or any product within the samesubscription group).

问题是服务器返回的 JSON 有时不包含“latest_receipt_info”键,它只包含环境、状态和收据字段。这种情况下如何确定用户的试用资格呢?非常感谢任何帮助。

P.s. JSON 始终包含状态 0,因此与服务器的通信正常。

编辑:如果缺少 key ,我不能简单地假设试用版不可用,因为我已经测试过没有 key 的情况,但在订阅时我会获得试用版。

最佳答案

对于没有自动续订订阅购买的收据,latest_receipt_info 键将会丢失。

I cannot just presume the trial is not available if the key is absent, because I have tested situations in which there is no key, but I am offered a trial upon subscription.

这是在沙盒中吗?我认为这在生产中是不可能的。

无论如何,Apple 会自动管理介绍资格,您无需执行任何操作即可让某人获得或不获得介绍优惠。本文档仅供您更新所需的任何 UI 组件 - 但我从未听说过应用程序因未在 UI 中反射(reflect)介绍资格而被拒绝。

关于swift - 使用可信服务器验证 IAP 收据。如果返回的 JSON 不包含 "latest_receipt_info" key ,如何确定试用资格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54876072/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com