“恢复购买”是什么意思?应用内购买是什么意思?

发布于 2024-12-09 19:33:23 字数 55 浏览 0 评论 0原文

我不太明白这个想法。 我是否必须为用户提供恢复按钮? 这个方法应该调用什么方法? 恢复会做什么?

I don't really understand this idea.
Do I have to provide a restore button for the user?
What method should this method invoke?
What will restore will do?

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

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

发布评论

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

评论(3

尴尬癌患者 2024-12-16 19:33:23

您通常使用以下代码恢复购买:

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

它将在所购买商品的观察者上重新调用 - paymentQueue:updatedTransactions 。这对于删除后重新安装应用程序或将其安装在不同设备上的用户非常有用。

并非所有类型的应用内购买都可以恢复。

You typically restore purchases with this code:

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

It will reinvoke -paymentQueue:updatedTransactions on the observer(s) for the purchased items. This is useful for users who reinstall the app after deletion or install it on a different device.

Not all types of In-App purchases can be restored.

错々过的事 2024-12-16 19:33:23

您会收到苹果的拒绝消息,因为您注册的应用内购买产品可能属于非续订订阅和消耗品类别。此类产品不会自动更新。您的应用程序中需要有明确的恢复按钮。

对于其他类型的产品,它将自动恢复。

请阅读以下文字,这将清除您对此的概念:

一旦交易被处理并从队列中删除,您的
应用程序通常不会再看到它。但是,如果您的申请
支持必须可恢复的产品类型,您必须包括
允许用户恢复这些购买的界面。这个界面
允许用户将产品添加到其他设备,或者如果原始设备
设备已被擦除,以在原始设备上恢复交易。

Store Kit 提供内置功能来恢复交易
非消耗性产品、自动续订订阅和免费
订阅。要恢复事务,您的应用程序调用
支付队列的restoreCompletedTransactions方法。付款队列
向 App Store 发送恢复交易的请求。在
返回时,App Store 会为每个交易生成一个新的恢复交易
之前完成的交易。恢复交易
对象的originalTransaction属性保存原始事务的副本
交易。您的应用程序通过以下方式处理恢复事务
检索原始交易并用它来解锁
购买的内容。 Store Kit 恢复之前的所有内容后
交易时,它通过调用支付队列观察者来通知他们
paymentQueueRestoreCompletedTransactionsFinished:方法。

如果用户尝试购买可恢复的产品(而不是
使用您实现的恢复接口),应用程序接收
该项目的常规交易,而不是恢复交易。
但是,用户不会再次为该产品付费。你的
应用程序应将这些交易视为与
原始交易。非续订订阅和消耗品
Store Kit 不会自动恢复产品。不更新
但是,订阅必须是可恢复的。要恢复这些产品,
当交易发生时,您必须在自己的服务器上记录交易
购买并提供您自己的机制来恢复这些交易
到用户的设备

You will get rejection message from apple just because the product you have registered for inApp purchase might come under category Non-renewing subscriptions and consumable products. These type of products will not automatically renewable. you need to have explicit restore button in your application.

for other type of products it will automatically restore it.

Please read following text which will clear your concept about this :

Once a transaction has been processed and removed from the queue, your
application normally never sees it again. However, if your application
supports product types that must be restorable, you must include an
interface that allows users to restore these purchases. This interface
allows a user to add the product to other devices or, if the original
device was wiped, to restore the transaction on the original device.

Store Kit provides built-in functionality to restore transactions for
non-consumable products, auto-renewable subscriptions and free
subscriptions. To restore transactions, your application calls the
payment queue’s restoreCompletedTransactions method. The payment queue
sends a request to the App Store to restore the transactions. In
return, the App Store generates a new restore transaction for each
transaction that was previously completed. The restore transaction
object’s originalTransaction property holds a copy of the original
transaction. Your application processes a restore transaction by
retrieving the original transaction and using it to unlock the
purchased content. After Store Kit restores all the previous
transactions, it notifies the payment queue observers by calling their
paymentQueueRestoreCompletedTransactionsFinished: method.

If the user attempts to purchase a restorable product (instead of
using the restore interface you implemented), the 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. Non-renewing subscriptions and consumable
products are not automatically restored by Store Kit. Non-renewing
subscriptions must be restorable, however. To restore these products,
you must record transactions on your own server when they are
purchased and provide your own mechanism to restore those transactions
to the user’s devices

花海 2024-12-16 19:33:23

它是可选功能吗?

如果当用户尝试购买非消耗性产品时您不提供它,AppStore 将恢复旧交易。但你的应用程序会认为这是新的交易。

如果您提供恢复机制,那么您的采购经理将看到恢复的交易。

如果应用程序应该区分此选项,那么您应该提供恢复以前购买的产品的功能。

Is it as optional functionality.

If you won't provide it when user will try to purchase non-consumable product AppStore will restore old transaction. But your app will think that this is new transaction.

If you will provide restore mechanism then your purchase manager will see restored transaction.

If app should distinguish this options then you should provide functionality for restoring previously purchased products.

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