ios订阅_iOS订阅测试分步指南

本文提供了一步一步的iOS订阅测试指南,帮助开发者了解如何在应用中进行订阅测试。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ios订阅

Testing a subscription can be as challenging as developing it. In this article, we will go over the complete process of subscription testing.

测试订阅与开发订阅一样具有挑战性。 在本文中,我们将介绍订阅测试的完整过程。

Fist of all, to do any type of subscription testing, you need to create a sandbox tester account:

首先,要执行任何类型的订阅测试,您需要创建一个沙箱测试器帐户:

  1. Login to your iTunes Connect Account-> Users and Access -> Sandbox ->Testers to create new testers.

    登录到您的iTunes Connect帐户->用户和访问权限->沙箱->测试人员,以创建新的测试人员。

  2. In your device, go to Settings-> iTunes & App Store -> Log out the current account and DO NOT log in sandbox tester account here

    在您的设备中,转到“设置”->“ iTunes和App Store”->“退出当前帐户”,并且不要在此处登录沙盒测试器帐户

Note: Don’t use your test user account to sign in to the production environment. If you do so, the sandbox account becomes invalid and it can no longer be used.

注意 :请勿使用您的测试用户帐户登录生产环境。 如果这样做,沙箱帐户将变得无效,无法再使用。

订阅测试的类型 (Types of Subscription Testing)

1.沙箱测试 (1. Sandbox Testing)

Sandbox testing can be categorized into two types, one is developer sandbox and the other is production sandbox. If you are running your app from Xcode, then the subscription testing runs on the developer sandbox. Whereas if you have distributed your app through testflight, then subscription testing runs on the production sandbox.

沙箱测试可以分为两种类型,一种是开发人员沙箱 ,另一种是生产沙箱 如果您从Xcode运行应用程序,则订阅测试将在开发人员沙箱上运行。 而如果您已通过testflight分发了应用程序,则订阅测试将在生产沙箱上运行。

Log in to your Sandbox account under iTunes & App Store as shown in below image:

如下图所示,登录iTunes和App Store下的您的Sandbox帐户:

Image for post

After logging into the Sandbox account, you are all set to test your subscriptions.

登录到沙盒帐户后,就可以测试订阅了。

Subscription Duration within the Sandbox testing:

沙盒测试中的订阅持续时间:

Duration of subscription has been reduced to facilitate testing allowing developers to test multiple purchases, renewals, and expirations.

减少了订阅期限,以方便测试,从而使开发人员可以测试多个购买,续订和到期。

Image for post

Auto-renewable subscriptions automatically renew for up to 6 times and expire after that.

自动续订的订阅最多可以自动续签6次,并在此之后过期。

测试步骤: (Testing steps:)

Testing Purchase, auto-renewal, and expiration:

测试购买,自动续订和到期

Let’s suppose your subscription is a 1-year auto-renewable subscription:

假设您的订阅是1年的自动续订订阅:

  1. Subscribe to your in-app subscription.

    订阅您的应用内订阅。
  2. Close the app and open it after 1 hour to make sure your app is still in an active subscription state.

    关闭应用程序,并在1小时后打开它,以确保您的应用程序仍处于活动订阅状态。
  3. Close the app and open it again after around 6 hours, your app should be reset to unsubscribed state. This happened because the sandbox environment automatically renews subscription up to 6 times.

    关闭应用程序,然后在大约6个小时后再次打开它,您的应用程序应重置为取消订阅状态。 发生这种情况是因为沙箱环境最多可以自动续订6次。

Test restore purchase for an active subscription:

测试活动订阅的还原购买:

One major drawback in the sandbox environment is that there’s no receipt file on the device until a subscription is bought whereas, in the production environment, a receipt file is formed as soon as the app is installed on the device.

沙盒环境中的一个主要缺点是,在购买订阅之前,设备上没有收据文件,而在生产环境中,将应用程序安装在设备上后便会形成收据文件。

  1. Subscribe to your auto-renewable subscription.

    订阅您的自动更新订阅。
  2. Delete the app on the device.

    删除设备上的应用。
  3. Reinstall the app and press the Restore purchase button.

    重新安装该应用,然后按恢复购买 按钮。

  4. If all these steps are done under the subscription test duration, then active subscription should be restored, otherwise, the user should be shown a message about no active subscription found.

    如果所有这些步骤都在订阅测试持续时间内完成,则应恢复活动订阅,否则,应向用户显示一条有关未找到活动订阅的消息。

Test restore purchase on multiple devices:

在多个设备上测试还原购买:

  1. Log into devices A and B with the same sandbox account.

    使用相同的沙箱帐户登录设备A和B。
  2. Subscribe to your subscription on device A.

    在设备A上订阅您的订阅。
  3. Install the app on device B.

    在设备B上安装该应用。
  4. Launch the app on device B and press the Restore Purchase button.

    在设备B上启动该应用,然后按“ 恢复购买”按钮。

TestFlight测试 (TestFlight Testing)

An application distributed by TestFlight will automatically use the production sandbox environment. All testing steps will stay the same as the development sandbox environment.

TestFlight分发的应用程序将自动使用生产沙箱环境。 所有测试步骤将与开发沙箱环境相同。

Production Testing

生产测试

For an app that has yet to be released on the App Store, getting an early version of the app approved is a great way to test subscriptions.

对于尚未在App Store上发布的应用,批准该应用的早期版本是测试订阅的好方法。

启动前的生产测试 (Pre-launch Production Testing)

  1. For this, you need to submit the app’s beta version to Apple’s review. Don’t forget to set the version release to Manual release.

    为此,您需要将应用程序的Beta版本提交给Apple审查。 不要忘记将版本发布设置为手动发布。

  2. Generate promo codes for the app from iTunesConnect.

    从iTunesConnect生成应用程序的促销代码。
  3. Using promo code, download the app from the App Store.

    使用促销代码,从App Store下载该应用程序。
  4. Subscribe to your subscription. As the app is approved by Apple (though not released), it will still perform the same way as a live app.

    订阅您的订阅。 由于该应用程序已获得Apple批准(尽管尚未发布),因此其运行方式仍与实时应用程序相同。

沙盒可靠性 (Sandbox Reliability)

The developer sandbox is famously unreliable. For some reason, Apple never fixed it or it may not know the inconsistency. Either way, don’t get stressed if it doesn’t work all the time.

开发人员沙箱众所周知是不可靠的。 由于某种原因,Apple从未修复它,或者它可能不知道不一致的地方。 无论哪种方式,如果一直无法正常工作,请不要感到压力。

重要要点 (Important takeaways)

  • Subscriptions are automatically renewed up to 6 times and expire after that. This behavior can’t be changed by the user.

    订阅最多可以自动续订6次,然后过期。 用户无法更改此行为。
  • There is no purchase receipt available in the sandbox environment until a purchase is made.

    在完成购买之前,沙盒环境中没有可用的购买收据。
  • Testers will not be charged for the purchases done in either Development or Production Sandbox environment

    在“开发”或“生产”沙盒环境中完成的购买均不向测试人员收费

翻译自: https://medium.com/dev-genius/step-by-step-guide-for-ios-subscription-testing-50851cea8953

ios订阅

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值