作为开发人员如何处理自动续订订阅

发布于 2024-10-19 12:16:37 字数 318 浏览 3 评论 0原文

这篇文章中,Apple 编写了如何从用户的角度启用自动续订订阅。但我的问题是作为应用程序的开发者如何处理这种自动续订订阅?

在我的应用程序(目前正在开发)中,用户可以通过应用程序内购买购买一些订阅(30 天、3 个月和 1 年)。付款成功后,我将购买的商品标识符发送到我的服务器,以保存新的订阅时间(也用于其他平台)。这在沙箱环境中完美运行。

但如果我正确理解这篇文章,自动续订订阅是从 AppStore 内部和我的应用程序内部执行的。我现在如何跟踪订阅情况?

In the this Article Apple wrote how to enable an auto-renewing subscription from the users point of view. But my question is how to handle this auto-renewing subscription as the developer of an app?

In my app (currently in developing) the user can buy some subscriptions (30 days, 3 months and 1 year) via in-app-purchase. After a successful payment I send the bought item identifier to my server to save the new subscription time (also used for other platforms). This works perfectly in the sandbox-environment.

But if I correctly understand the article the auto-renewing subscriptions is performed from inside the AppStore and inside my app. How can I now track the subscription?

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

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

发布评论

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

评论(2

圈圈圆圆圈圈 2024-10-26 12:16:37

如果订阅是自动续订的,交易将不会通过 paymentQueue:updateTransactions 方法。更新仅在商店中进行。

如果您想测试它,您必须:

  • 重新验证您的应用程序服务器上的收据(如果您将收据存储在那里)。
  • 在 iOS 客户端上重新验证收据

请参阅:http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/VerifyingStoreReceipts/VerifyingStoreReceipts.html#//apple_ref/doc/uid/ TP40008267-CH104-SW1

为了避免每次启动/激活都测试自动续订,您应该存储订阅期的 endDate 以便之后测试续订。

另请参阅:

然而,沙盒中似乎存在一个错误。订阅有时会更新,有时不会。很难测试....

If a subscription is autorenewed, the transaction won't pass the paymentQueue:updateTransactions method. The renew just happens on the Store.

If you want to test for it you have to either:

  • Revalidate the receipt on your application server, if you store the receipt there.
  • Revalidate the receipt on your iOS client

See: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/VerifyingStoreReceipts/VerifyingStoreReceipts.html#//apple_ref/doc/uid/TP40008267-CH104-SW1

In order to avoid testing for an autorenew each launch/activation you should store the endDate of the subscription period to test for a renew afterwards.

Also see: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RenewableSubscriptions/RenewableSubscriptions.html#//apple_ref/doc/uid/TP40008267-CH4-SW4

However, there seems to be a bug in the sandbox. Subscriptions sometimes get renewed, sometimes not. Hard to test....

时光倒影 2024-10-26 12:16:37

基于苹果 应用内购买文档,我的印象是,每当您需要确定用户自动续订订阅的状态时,您都会恢复他们的交易。

这将导致应用程序商店将所有自动续订交易发送到您的应用程序,此时您将处理收据并提供适当的内容。

据推测,您只需要在用户当前的订阅(您可以在本地跟踪)设置为过期时或在他们首次安装应用程序时执行此操作。

based on the (rather scant) info found in apple's in-app-purchase documentation, my impression is that whenever you need to determine the state of a user's auto-renewal subscription, you would restore their transactions.

this would cause the app store to send all auto-renewal transactions to your app, at which point you would process the receipts and make the appropriate content available.

presumably, you would only need to do this when the user's current subscription (which you can track locally) is set to expire, or when they are first installing the app.

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