如何在App购买中反复测试…?

时间:2022-09-23 22:44:51

My in app purchase project working perfectly now, but I need to test purchasing and when once purchase is successfully done it cannot be undone? How can I test in app purchasing and upgrading my app to full version when it can be done just one time?

我的应用程序购买项目现在工作的很好,但是我需要测试采购,一旦购买成功,它就无法完成了吗?我怎样才能在一次就能完成的情况下,在app购买和升级中进行测试呢?

5 个解决方案

#1


11  

  1. Delete the app from your device
  2. 从你的设备中删除应用程序
  3. Run "Clean" from the Product menu in XCode
  4. 在XCode中运行“Clean”产品菜单
  5. On your device, go to "Settings", "Store", "Apple ID", and Sign Out
  6. 在你的设备上,进入“设置”,“存储”,“Apple ID”,然后签名。
  7. Start your app again, since you're not signed in to any account, the previous in-app purchase will not be recognized and you'll be able to buy it/download it again with the same test user account
  8. 再次启动应用程序,因为您没有登录到任何帐户,所以不会识别之前的内购,您可以使用相同的测试用户帐户再次购买/下载它

#2


9  

None of the answers is really correct. Even if the you remove the cached purchase from your testing device, the product is marked as bought in Apple's server, associated to your test Apple ID. So the testing will not exactly reproduce the expected behavior. This is very important for testing the restore products function use cases, for example.

没有一个答案是正确的。即使您从测试设备中删除了缓存的购买,该产品也会标记为在苹果服务器中购买的,与您的测试Apple ID相关联。这对于测试恢复产品功能用例非常重要。

As far as I know, the real answer to this question is: You can't without creating a new test account, but that's not a really big deal, you can even use an invented email address (no need to validate it), and you can delete the account after using it.

据我所知,这个问题的真正答案是:你不可能不创建一个新的测试帐户,但这并不是什么大问题,你甚至可以使用一个虚构的电子邮件地址(不需要验证它),你可以在使用后删除这个帐户。

#3


6  

If you delete your app and reinstall it, you can repurchase products. It follows the same code flow and nearly exactly the same user experience (there is a dialog letting you know that you can repurchase for free the second time). Also you can create more test users in iTunes Connect to be sure that you are doing completely clean testing.

如果你删除你的应用并重新安装它,你可以重新购买产品。它遵循相同的代码流和几乎完全相同的用户体验(有一个对话框让您知道您可以再次免费购买)。您还可以在iTunes Connect中创建更多的测试用户,以确保您正在进行完全干净的测试。

I've spent several weeks deleting and reinstalling my app many times per day to ensure that my storekit implementation works just like I want it too.

我已经花了数周的时间每天多次删除和重新安装我的应用程序,以确保我的storekit实现像我希望的那样工作。

#4


2  

All you have to do is delete your app from the device. This will wipe out any NSUserDefaults where you may have stored in-app purchase details.

你所要做的就是从设备中删除你的应用。这将消除任何NSUserDefaults,因为你可能会在app中存储购买细节。

Once you run your app again, make the purchase one more time, and Store Kit will tell you this:

一旦你再次运行你的应用,再次购买,商店工具包会告诉你:

"You've already purchased this. Tap OK to download it again for free"

“你已经购买了这个。点击确定免费下载

Once you tap OK, you go through the same sequence of events you did when you made your first in-app purchase, so you can test again and again.

一旦你点击OK,你就会经历和你第一次在应用程序内购买时一样的事件序列,所以你可以一次又一次地测试。

#5


0  

Use unit tests on your app, with false data, until you're satisfied.

在你的应用上使用单元测试,使用错误的数据,直到你满意为止。

(create test code - for each module you use)

(为您使用的每个模块创建测试代码)

I think I'll need more description of your process to have a better answer.

我想我需要对你的过程有更多的描述才能得到更好的答案。

#1


11  

  1. Delete the app from your device
  2. 从你的设备中删除应用程序
  3. Run "Clean" from the Product menu in XCode
  4. 在XCode中运行“Clean”产品菜单
  5. On your device, go to "Settings", "Store", "Apple ID", and Sign Out
  6. 在你的设备上,进入“设置”,“存储”,“Apple ID”,然后签名。
  7. Start your app again, since you're not signed in to any account, the previous in-app purchase will not be recognized and you'll be able to buy it/download it again with the same test user account
  8. 再次启动应用程序,因为您没有登录到任何帐户,所以不会识别之前的内购,您可以使用相同的测试用户帐户再次购买/下载它

#2


9  

None of the answers is really correct. Even if the you remove the cached purchase from your testing device, the product is marked as bought in Apple's server, associated to your test Apple ID. So the testing will not exactly reproduce the expected behavior. This is very important for testing the restore products function use cases, for example.

没有一个答案是正确的。即使您从测试设备中删除了缓存的购买,该产品也会标记为在苹果服务器中购买的,与您的测试Apple ID相关联。这对于测试恢复产品功能用例非常重要。

As far as I know, the real answer to this question is: You can't without creating a new test account, but that's not a really big deal, you can even use an invented email address (no need to validate it), and you can delete the account after using it.

据我所知,这个问题的真正答案是:你不可能不创建一个新的测试帐户,但这并不是什么大问题,你甚至可以使用一个虚构的电子邮件地址(不需要验证它),你可以在使用后删除这个帐户。

#3


6  

If you delete your app and reinstall it, you can repurchase products. It follows the same code flow and nearly exactly the same user experience (there is a dialog letting you know that you can repurchase for free the second time). Also you can create more test users in iTunes Connect to be sure that you are doing completely clean testing.

如果你删除你的应用并重新安装它,你可以重新购买产品。它遵循相同的代码流和几乎完全相同的用户体验(有一个对话框让您知道您可以再次免费购买)。您还可以在iTunes Connect中创建更多的测试用户,以确保您正在进行完全干净的测试。

I've spent several weeks deleting and reinstalling my app many times per day to ensure that my storekit implementation works just like I want it too.

我已经花了数周的时间每天多次删除和重新安装我的应用程序,以确保我的storekit实现像我希望的那样工作。

#4


2  

All you have to do is delete your app from the device. This will wipe out any NSUserDefaults where you may have stored in-app purchase details.

你所要做的就是从设备中删除你的应用。这将消除任何NSUserDefaults,因为你可能会在app中存储购买细节。

Once you run your app again, make the purchase one more time, and Store Kit will tell you this:

一旦你再次运行你的应用,再次购买,商店工具包会告诉你:

"You've already purchased this. Tap OK to download it again for free"

“你已经购买了这个。点击确定免费下载

Once you tap OK, you go through the same sequence of events you did when you made your first in-app purchase, so you can test again and again.

一旦你点击OK,你就会经历和你第一次在应用程序内购买时一样的事件序列,所以你可以一次又一次地测试。

#5


0  

Use unit tests on your app, with false data, until you're satisfied.

在你的应用上使用单元测试,使用错误的数据,直到你满意为止。

(create test code - for each module you use)

(为您使用的每个模块创建测试代码)

I think I'll need more description of your process to have a better answer.

我想我需要对你的过程有更多的描述才能得到更好的答案。