恢复收据和购买收据之间的歧义

发布于 2024-10-31 04:48:43 字数 234 浏览 2 评论 0原文

我很困惑使用服务器模型应用应用内购买。

我在 StoreKit 指南中读到:

如果用户尝试购买非消耗性产品或可更新订阅,他们已经 购买后,您的应用程序会收到该项目的**常规交易,而不是恢复交易。然而, 用户无需再为该产品付费。您的应用程序应该同等对待这些事务 到原始交易的那些。

所以告诉我我怎么知道用户是否已经购买了该物品或者他已经恢复了该物品???

I'm quite confused applying InApp Purchase using a server model.

I read this in the StoreKit Guide:

If the user attempts to purchase a nonconsumable product or a renewable subscription they have already
purchased, your application receives a **regular transaction for that item, not a restore transaction. However,
the user is not charged again for that product. Your application should treat these transactions identically
to those of the original transaction.

So tell me how will i knw that whether the user has purchased the item or he has restored the item????

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柠檬 2024-11-07 04:48:43

您应该跟踪已购买的商品,并将其从用户必须购买的选项列表中删除。

如果您这样做,用户将永远不会尝试购买他们已经打孔的东西。

首次安装应用程序时,您可能想要恢复以前购买的项目(如果有)。为此,您可以调用restoreCompletedTransactions,并获得正常的单独回调paymentQueueRestoreCompletedTransactionsFinished:

来回答你的问题。

  1. 恢复的项目通过 paymentQueueRestoreCompletedTransactionsFinished: 方法

  2. 进入

    购买的项目通常通过 < code> paymentQueue:updatedTransactions: 方法

  3. 正常购买且已付款的商品进入在 paymentQueue:updatedTransactions: 方法上。

你无法区分 2. 和 3. 之间的区别。这是故意这样做的。

You should keep track of the items that have been purchased and remove them from the list of options the user has to buy.

If you do this, the user will never attempt to purchase something they have already punched.

When the app is first installed you may want to restore items that have been previously purchased (if there are any). To do this you call restoreCompletedTransactions and you get a separate callback to normal: paymentQueueRestoreCompletedTransactionsFinished:.

To answer your question.

  1. Restored items come in on the paymentQueueRestoreCompletedTransactionsFinished: method

  2. Items purchased normally come in on the paymentQueue:updatedTransactions: method

  3. Items purchased normally, which have already been paid for, come in on the paymentQueue:updatedTransactions: method.

You can not tell the difference between 2. and 3. This is done on purpose.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文