Requesting an In App Purchase in iOS 13 fails

牧云@^-^@ 提交于 2019-12-19 12:24:15

问题


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})

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.

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.

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


回答1:


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

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




回答2:


I had the same issue, iOS13 Simulators produced the same error, iOS12 Simulators were working well. I then tried out on the iPhone with iOS13 installed, there the calls were working flawlessly too.

Hoping that it'll be fixed soon in Xcode Simulators, I guess until then we are stuck with the error.

Edit: Now it seems to work also in iOS 13 Simulator Devices.




回答3:


Note: I've updated the answer, read the Edit part.

To share my experience, it seems that this problem does not exist any more in Xcode 11.1 GM Seed. There's no need to restart Simulators or Xcode to make in-app purchases work anymore.

I had submitted an app for review and it was rejected because of that particular error. As it turns out, it was rejected for a stupid reason as it wasn't my app's bug, however I spent hours trying to get around it.

So, just update to Xcode 11.1 GM Seed and run again. Everything will be okay.

EDIT

The issue still exists in Xcode 11.1 and apparently I was just lucky that it didn't happen to me again. However, I had a second rejection for the exact same reason. What eventually worked and made my app get approved was this:

I had to update my IAP record on App Store by editing and saving it again.

So, I recommend you to try the same; change something temporarily in your IAPs, save and then revert your changes (and save again) so records on the App Store to be refreshed.

FYI, after the second rejection Apple invalidated my IAP and therefore showed me the way. It looks like to be a known issue to them at the end.

For details read this discussion I wrote on Reddit.



来源:https://stackoverflow.com/questions/58020258/requesting-an-in-app-purchase-in-ios-13-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!