如何测试可再生订阅(应用程序商店) [英] How to test renewable subscriptions (App Store)

查看:140
本文介绍了如何测试可再生订阅(应用程序商店)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实施我的应用程序自动再生订阅,我不知道是否有当认购期内用完,并创建一个新的事务,以模拟的方式。

I'm implementing auto renewable subscriptions in my app and I wonder if there is a way to simulate when a subscription period runs out and a new transaction is created.

该应用程序连接到在线服务,始终保持用户的轨道,如果他们有premium准入与否。作为了解我,有两种方式,当一事务被以检测。

The app is connected to a online service that always keeps track of the users and if they have "premium access" or not. As understand i, there are two ways to detect when a transaction is made.


  1. 该应用程序启动并updatedTransactions:叫我PaymentObserver作为SKPaymentTransactionStateRestored。然后我,从应用程序,将这些信息发送到更新订阅服务器。

  1. The app is launched and updatedTransactions: is called in my PaymentObserver as a SKPaymentTransactionStateRestored. I then, from the app, send this information to the server which updates the subscription.

我定期检查App Store的API和比较的最新收据与一个在我的数据库。如果有一个新的,一个事务已被制成,我延伸订阅。

I regularly check the App Store API and compare the "latest receipt" with the one in my database. If there is a new one, a transaction has been made and I extend the subscription.

无论哪种方式,我需要模拟的认购期内用完而一个新的事务是由应用程序商店取得。我该怎么做呢?

Either way, I need to simulate that the subscription period runs out and a new transaction is made by the App Store. How do I do this?

推荐答案

您确定您需要模拟这个?我想你会发现,在沙箱中,认购长度都非常短,让所有你需要做的就是喝咖啡或什么杯,他们将结束,然后可以测试会发生什么。

Are you sure you need to simulate this? I think you'll find that in the sandbox, the subscription lengths are made very short so that all you have to do is get a cup of coffee or something and they will expire and then you can test what happens.

时间的量根据认购的长度而改变,但我认为7天认购在沙盘短短几分钟内到期。

the amount of time varies depending on the length of the subscription, but I think the 7 day subscription expires in just a few minutes in the sandbox.

这篇关于如何测试可再生订阅(应用程序商店)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆