且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS应用内购买收据验证-如果服务器关闭,该怎么办?

更新时间:2022-12-31 09:37:57

您的序列在第3点不正确.

Your sequence is incorrect at point 3.

您的应用收到更新后的交易,然后启动验证和持久购买所需的任何逻辑.您的应用完成此操作后,它将完成付款队列上的交易.届时,从tye App Store的角度看,购买已完成.

Your app receives the updated transaction and then initiates whatever logic is required to validate and persist the purchase. Once your app has done this, it completes the transaction on the payment queue. At that point the purchase is complete from tye App Store point of view.

如果服务器已关闭并且无法验证收据,则应向用户提供某种形式的错误,并可能重试验证.

If your server is down and you are unable to validate the receipt, you should provide some form of error to the user and perhaps re-try the validation.

该交易将保持待处理状态,并在下次启动您的应用程序时重新呈现给您的支付队列观察者.这就是为什么您的应用在启动时首先要做的就是注册付款队列观察器对象.

The transaction will be held in a pending state and will be re-presented to your payment queue observer when your app is next launched. This is why on of the first things your app should do on launch is register a payment queue observer object.

当您最终能够完成收据验证并继续购买时,您就可以在付款队列上完成交易了.

When you are finally able to complete the receipt validation and persist the purchase you complete the transaction on the payment queue.