在iOS 13中请求应用内购买失败 [英] Requesting an In App Purchase in iOS 13 fails

查看:56
本文介绍了在iOS 13中请求应用内购买失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 SwiftyStoreKit 来请求In App Purchase,并且在iOS 13上仅收到此错误:

I use SwiftyStoreKit to request In App Purchases and get only this error with iOS 13:

Error: Optional(Error Domain=ASDErrorDomain Code=507 "Error decoding object" UserInfo={NSLocalizedDescription=Error decoding object, NSLocalizedFailureReason=Attempted to decode store response})

我无法请求有关产品的信息,也无法使用沙盒帐户进行购买.但是,它可以在我的设备上的iOS 12.1中正常工作.它不适用于iPhone 11模拟器或带有iOS 13的实际设备.

I cannot request information about the products, nor make purchases with a sand box account. However, it works fine in iOS 12.1 on my device. It does not work with the iPhone 11 simulator or an actual device with iOS 13.

我发现很多情况, Xcode 11 GM种子1 beta模拟器存在此问题,但尚未找到解决方案.我还使用新发布的 Xcode 11 GM种子2 版本对其进行了测试,但没有针对我的修复程序.

I have found a lot, that the Xcode 11 GM seed 1 beta simulator had this problem, but have not found a solution yet. I also tested it with the new released Xcode 11 GM seed 2 version, but there was no fix for me.

在安装了iOS 13的情况下,有人对我可以如何再次请求和购买In App Purchase有解决方案吗?

Does anyone have a solution on how I can request and purchase In App Purchases again with iOS 13 installed?

推荐答案

重新启动Xcode和模拟器可以解决问题:现在,我的应用内购买已正确加载到iOS 13模拟器中.

Restarting Xcode and simulator did the trick: now my in-app purchases load properly in iOS 13 simulator.

编辑:这也发生在Xcode 11版本中.有时会发生,但是重新启动Xcode和模拟器仍然有帮助.

EDIT: This happens in release Xcode 11 too. And happens once in a while, but restarting Xcode and simulators still helps.

编辑2 :在Xcode 12 Beta中也存在此错误.但是解决方案是创建新的StoreKit配置文件(在 File-> New 菜单中)

EDIT 2: In Xcode 12 beta this bug is also present. But the solution is to create new StoreKit Configuration file (in File -> New menu)

然后将所有产品添加到此处.使用与AppStore Connect中相同的产品ID.

Then add all your products there. Use the same product id's as in AppStore Connect.

然后将此文件添加到运行方案"配置中.

Then add this file to Run Scheme configuration.

这篇关于在iOS 13中请求应用内购买失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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