是否测试沙盒自动续订订阅 IOS?

Does test sandbox autorenew subscriptions IOS?

我一直致力于实现自动续订订阅应用程序。我实际购买的订阅工作正常......我选择 1 个月的订阅,它应该在到期前持续 3 分钟......最初的购买实际上工作正常......但 3 分钟后它过期了,我再也看不到了自动续订发生或获得新收据或任何东西,所以应用程序正确地只是说..走开....

文件上说它应该自动续订 5 次才能自动取消,但我似乎从来没有在初次购买后收到新收据或任何东西。

还有 something/somewhere 我应该查看或检查的其他内容吗?我错过了什么吗?

沙盒用户订阅会自动续订,但时间较短 - 每隔几分钟就会续订一次。

For the sake of testing, there are some differences in behavior between auto-renewable subscriptions in the production environment and in the test environment.

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.

摘自 apple documentation.

至于收据 - 您不会获得新的收据,但您应该在同一张收据下获得另一笔交易以进行续订。交易将在交易队列中等待你,你应该使用 SKPaymentTransactionObserver 来监视 SKPaymentQueue 中的新交易。如果您验证收据,您还将看到更新过期日期的新交易。

After a subscription is successfully renewed, Store Kit adds a transaction for the renewal to the transaction queue. Your app checks the transaction queue on launch and handles the renewal the same way as any other transaction. Note that if your app is already running when the subscription renews, the transaction observer is not called; your app finds out about the renewal the next time it’s launched.

也来自同一文档。

就我而言,在订阅的沙盒测试中,它只会在第一次购买订阅时自动续订 5 美元。后续订阅购买将在购买后停止续订。