商店套件交易失败
我正在尝试使用 iPhone 3.0 SDK 测试 Store Kit 交易。我的代码基于 Store Kit 编程指南中的示例代码,但我不断收到失败的交易(状态:SKPaymentTransactionStateFailed)。然而,交易的错误属性为零,因此这并不能说明情况。
当我尝试购买该产品时,我可以使用测试帐户登录并接受购买,但随后我会看到一个对话框,其中显示:
“您已经购买了此产品,但尚未下载。点击好的,现在就下载。”
当我点击“确定”时,什么也没有发生。我的 transactionObserver 不再收到发送给它的消息。
I'm attempting to test a Store Kit transaction with the iPhone 3.0 SDK. I am basing my code off the sample code in the Store Kit Programming Guide, but I keep getting failed transactions (status: SKPaymentTransactionStateFailed). However, the transaction's error property is nil, so that doesn't shed any light on the situation.
When I attempt to purchase the product, I am able to log-in with a test account and accept the purchase, but then I get a dialog box that says:
"You've already purchased this but it hasn't been downloaded. Tap OK to download it now."
When I tap "OK" nothing happens. My transactionObserver doesn't get any more messages sent to it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我对消耗品也有同样的问题。事实证明上面的答案是正确的。我的队友不小心删除了我的测试帐户。创建新的后一切正常。
I had the exact same issue with consumable items. It turns out the above answer was correct. My teammate accidentally deleted my test account. Everything works fine after I created a new one.
事实证明,我的测试帐户已从 iTunes Connect 中删除(尽管它允许我登录)。我创建了一个新的测试帐户并且它开始工作。我相信“点击确定立即下载”消息实际上是尝试重新启动事务,然后该事务将再次失败。
As it turns out, my test account had been deleted from iTunes Connect (even though it was letting me log in). I created a new test account and it started to work. I believe the "Tap OK to download it now" message was actually an attempt to re-initiate the transaction, which would then fail again.
我遇到了这个确切的问题,事实证明我使用的是无效的测试帐户(测试帐户绑定到与应用程序链接到的不同的苹果开发者帐户)。检查了测试帐户凭据,一切都很顺利。
@wdlindmeier:我看到你也有相同的解决方案:我建议你接受这个答案或你自己的答案,以防对任何人有帮助。 :)
I had this exact problem, turns out I was using an invalid test account (The test account was bound to a different apple developer account from the one the application was linked to). Checked test account credentials and everything was hunky dory.
@wdlindmeier: I see you also had the same solution: I'd suggest that you accept this answer or your own in case that helps anybody. :)
我在沙箱环境中遇到了同样的问题,发现它可能与 SKPaymentTransactionObserver 有关。
当我第一次实现这个时,我分配了 SKPaymentTransactionObserver 并仅在我开始购买时添加它。此外,一旦交易成功或失败,我就删除了 SKPaymentTransactionObserver。我发现在这种情况下交易总是未完成,
即使我在删除 SKPaymentTransactionObserver 之前完成了交易。
所以我的解决方案是,在应用程序启动时分配 SKPaymentTransactionObserver,然后在应用程序终止之前不要删除它。 “未完成”的交易仍需正确完成。
希望这对你有用。
I’ve met the same issue in sandbox environment and found it may related to SKPaymentTransactionObserver.
When I firstly implement this, I did alloc SKPaymentTransactionObserver and added it only when I started doing purchase. Also I removed SKPaymentTransactionObserver as soon as the transaction is succeed or failed. I found the transaction is always unfinished in this case,
even I finished the transaction before removing SKPaymentTransactionObserver.
So my solution is, alloc a SKPaymentTransactionObserver when app started, then do NOT remove it until the app terminated. The “unfinished” transaction still to be finished correctly then.
Hope this is working for you.
我也一直收到这个。
事实证明,您无法在模拟器中测试应用内购买!
I kept getting this too.
It turns out you can't test in app purchases in the simulator!