沙盒:是否可以模拟失败或中断的应用内购买? [英] Sandbox: Is possible to simulate a failed or interrupted In App Purchase?

查看:37
本文介绍了沙盒:是否可以模拟失败或中断的应用内购买?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在我的应用中实施了应用内购买.好在 Apple 记录了整个过程.

I have recently implemented In App Purchasing in my app. Good thing Apple has documented the whole process very well.

使用这些文档,我终于能够通过沙盒测试应用内购买,这是一个非常方便的功能.我已经成功测试了我的应用程序,因此当我点击 buyButton 时,它可以对 StoreKit 返回的任何内容做出反应.

Using those docs, I'm finally able to test In App Purchasing through the Sandbox, which is a very convenient feature. I have successfully tested my app so that it reacts to whatever the StoreKit returns when I tap the buyButton.

现在是我的问题.从文档中可以看出,沙盒模拟了没有财务内容的交易过程.所以我想买多少就买多少(顺便说一下,我买的是消耗品,而且只买消耗品).此外,沙盒将始终模拟成功的交易,无论如何.那么,是否有可能让沙盒模拟一个失败交易,更好的是,一个中断交易?

Now here's my question. From the docs, it says that the Sandbox simulates the transaction process with no financial stuff. So I'm free to buy as much as I want (by the way, I'm buying consumables and only consumables). Also, the Sandbox will ALWAYS simulate a successful transaction, no matter what. So, is it possible to have the Sandbox simulate a failed transaction, and better yet, an interrupted transaction?

我想这样做是为了在这些事件发生时捕获可能的错误(尽管我在某处阅读了 StoreKit 已经处理过的内容)并将它们显示在屏幕上(至少),只是通知用户在交易过程中发生了什么.

I want to do that to trap possible errors when those events happen (although I've read somewhere that StoreKit already handles that) and display them on the screen (at the very least), just to inform the user what's happening during the transaction process.

提前致谢.

推荐答案

模拟许多常见的网络事务问题的一种简单方法是从无线接入点的背面拔下网络电缆,该接入点在网络中的各个点使用过程.您可以尝试诸如拔掉 wifi 的 WAN 电缆,然后使用备用或有线访问从 iTunes Connect 中移除您的 IAP,然后重新启用 wifi 访问.

An easy way to simulate lots of common networked transaction problems is to unplug the network cable from the back side of the wifi access point being used at various points in the process. You could try stuff like unplugging the wifi's WAN cable, then use alternate or cabled access to remove your IAP from availability in iTunes Connect, then re-enable wifi access.

这篇关于沙盒:是否可以模拟失败或中断的应用内购买?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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