Error Domain=SKErrorDomain Code=2 “无法连接到 iTunes Store” UserInfo=0x6083900 {NSLocalizedDescription=无法连接到 iTunes Store}

发布于 2024-10-20 12:04:07 字数 392 浏览 3 评论 0原文

我正在尝试使用测试帐户测试我的应用内购买。我第一次尝试购买应用内自动更新订阅时,一切都很顺利,没有错误,交易按预期完成,交易状态更新为“SKPaymentTransactionStatePurchased”。但是,当我测试用户尝试再次购买订阅的场景时,我不断收到上述错误。尽管商店工具包框架显示一个对话框,表明用户已经订阅,但我的观察者看到交易在状态中失败(SKPaymentTransactionStateFailed)。

storekit 文档明确指出 “如果用户尝试购买他们已经购买的非消耗性产品或可更新订阅,您的应用程序会收到该商品的常规交易,而不是恢复交易。但是,用户不会再次为该产品付费。您的应用程序应该处理这些交易与原始交易相同”。 就我而言,当我再次购买时,交易状态始终为“失败”。

有什么想法吗?这是在沙盒测试环境中。

I am trying to test my in app purchases using a test account. The first time I try to purchase an in app auto renewable subscription, everything goes smooth, no errors and the transaction is complete as expected with the transaction state updated to "SKPaymentTransactionStatePurchased". But, when I test for the scenario of a user trying to purchase the subscription again, I keep getting the above error. Even though the store kit framework displays a dialog saying that the user is already subscribed, my observer sees the transaction as failed in the state(SKPaymentTransactionStateFailed).

The storekit documentation clearly says
"If the user attempts to purchase a nonconsumable product or a renewable subscription they have already purchased, your application receives a regular transaction for that item, not a restore transaction. However, the user is not charged again for that product. Your application should treat these transactions identically to those of the original transaction".
In my case here, I keep getting the transaction state as "failed" when I do the purchase again.

Any ideas? This is in the sandbox test environment.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

终止放荡 2024-10-27 12:04:07

这是预期的行为。您仍然会收到一笔交易,它只是将其标记为失败状态,因为它并不代表新的成功购买。重新购买他们已经订阅的订阅(大概是在全新安装后恢复购买)不是您应该鼓励用户采取的旅程,他们应该被引导至恢复购买功能。

可以说,您可能希望每次都询问失败的购买,看看这是否是用户想要做的事情,但随后您必须做大量的工作来尝试区分哪些是真正的失败,哪些是真正的失败。是错误的恢复。但我想说的是,有一个大的“恢复”按钮并引导人们这样做要容易得多。

This is the expected behavior. You still receive a transaction, it just marks it in a failed state because it does not represent a new, successful purchase. Repurchasing a subscription they already subscribe to (presumably to restore a purchase after a fresh install) is not a journey you should encourage your users to take, they should be directed towards the restore purchases function.

Arguably you might want to interrogate your failed purchases every time to see if this is what the user was trying to do, but then you'd have to do a fair amount of messing around to try and distinguish which ones were genuine failures and which one's were erroneous restores. but I'd say it's much easier to have a big 'restore' button and direct people towards that.

℉服软 2024-10-27 12:04:07

如果您从应用程序商店应用程序注销,当您再次购买时它似乎可以工作。但如果您的用户尝试两次购买同一产品,问题仍然存在。

If you log out from the app store application, it seems to be working when you purchase again. But problem continues if your user try to purchase the same product twice.

jJeQQOZ5 2024-10-27 12:04:07

当沙盒服务器关闭和/或损坏时,我得到了这个信息。检查苹果的开发者论坛,看看是否有其他人得到同样的东西。

[需要开发者登录]
http://devforums.apple.com/community/ios/integration/storekit

I was getting this when the Sandbox servers were down and/or broken. Check on Apple's developer forum to see if anyone else is getting the same thing.

[Developer Login Required]
http://devforums.apple.com/community/ios/integration/storekit

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文