iOS沙箱环境自动续订订阅

发布于 2024-12-13 22:17:40 字数 337 浏览 4 评论 0原文

关于 iOS 自动续订订阅,我有以下问题

a) 自动续订订阅真的在沙盒环境中自动续订吗?问题似乎是订阅不会自动续订,尽管文档说即使在沙盒环境中也应该会发生 6 次。

b) 我们是否需要调用restoreCompletedTransactions来获取自动延长订阅的新收据,或者- paymentQueue:updatedTransactions:方法是由iOS自动调用的吗? (我猜它会自动调用“启动”和“后台轮换”,不确定)

c) 您如何在多个设备上处理相同的订阅?这可以通过restoreCompletedTransactions来处理,但是调用它会提示用户密码,所以每次应用程序启动时调用它不是很方便。

I have the following questions regarding iOS auto-renewable subscriptions

a) Are auto-renewal subscriptions really auto-renewing in the sandbox environment? The problem seems to be that subscriptions are not renewed automatically although the documentation says that even in sandbox environment it should happen 6 times.

b) Do we need to call restoreCompletedTransactions to get new receipt for automatically extended subscription, or is -paymentQueue:updatedTransactions: method called automatically by iOS? (I guess it automatically called on 'launch' & 'rotation out of background' not sure)

c) How have you handled the same subscription on multiple devices? This can be handled by restoreCompletedTransactions, but calling it will prompt users password, so it is not very handy to call it every time the app starts.

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

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

发布评论

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

评论(2

彻夜缠绵 2024-12-20 22:17:40

a) 自动续订订阅在沙盒环境中不一致。有时订阅会在结束前续订多次(大约 5 次)。其他时候它根本不会更新。

b) (仅限 iOS6 交易收据)如果您存储以前的收据(最好在您的服务器上),则无需调用 restoreCompletedTransactions 来检查订阅的状态 。只需获取您为该用户存储的任何订阅收据并将其提交到 App Store 进行验证即可。他们将回复 latest_receipt_info,其中包括 expires_date,您可以用它来确定当前的订阅状态。

c) 您应该提示新用户“恢复以前的购买”,此时您可以调用restoreCompletedTransactions。然后将其中一张收据(最好来自您的服务器)提交到 App Store 进行验证,以获取有关交易的解码详细信息。在收据信息中查找关键的original_transaction_id。这将始终包含该用户第一次向您发起订阅的 ID。如果您将此 ID 与系统中的其他 ID 进行比较,您应该能够确定哪些设备共享 Apple 帐户。 (由于 Apple 不允许您查看用户的 Apple ID,因此这是识别跨多个设备的帐户的最佳方式)。

类似于这个问题:
iOS 自动续订已于当前结束时过期订阅期

a) Auto-renewing subscriptions are inconsistent in the sandbox environment. Sometimes a subscription will renew multiple times (about 5) before ending. Other times it won't renew at all.

b) (iOS6 transaction receipts only) You don't need to call restoreCompletedTransactions to check the status of a subscription if you're storing previous receipts (preferably on your server). Just take any subscription receipt you've stored for that user and submit it to the App Store for verification. They'll respond with the latest_receipt_info including the expires_date which you can use to determine current subscription status.

c) You should prompt new users to "Restore Previous Purchases" at which point you call restoreCompletedTransactions. Then submit one of those receipts (preferably from your server) to the App Store for verification to get decoded details about the transaction. Look for the key original_transaction_id in the receipt info. This will always contain the id of the very first time this user initiated a subscription with you. If you compare this ID to others in your system, you should be able to determine which devices share an Apple account. (Since Apple doesn't allow you to see a user's Apple ID, this is the best way to identify an account that spans multiple devices).

Similar to this question:
iOS auto-renew expired at the end of current subscription period

浪漫人生路 2024-12-20 22:17:40

除此之外,苹果文档中的行似乎是行 被误解

续订速度加快,自动续订订阅每天最多续订六次。这可以让您测试您的应用如何处理订阅续订、订阅失效以及包含间隙的订阅历史记录。

这似乎意味着所有订阅每天只会续订 6 次。而不是每次订阅都会在取消之前续订 6 次。这让我困惑了一段时间。

似乎也是24小时内的。在给定时间不刷新。例如,我在上午 11 点进行了订阅,但没有续订。我下午2点又做了一个,更新了6次。

To add to this it seems that the line in Apple's documentation is being misinterpreted

Renewal happens at an accelerated rate, and auto-renewable subscriptions renew a maximum of six times per day. This lets you test how your app handles a subscription renewal, a subscription lapse, and a subscription history that includes gaps.

This seems to mean that all subscriptions per day will only renew 6 times. Rather than each subscription will renew 6 times before canceling. This threw me for a while.

It also seems to be in a 24 hour period. Not refreshing at a given time. For example, I made a subscription at 11am that did not renew. I made one again at 2pm that renewed 6 times.

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