In-App-Purchase takes too long time to show confirmation alert view

流过昼夜 提交于 2019-12-03 12:47:37

This should have nothing at all to do with when an actual user tries to make the purchase, this is because you are running the app in the sandbox environment, also, if your using the simulator this would make it even slower. Also, even when an actual user does make the purchase, the phone has to connect to apple servers, find the IAP from the millions of others by it's id, make sure information matches, send this information back to the phone securely using encryption, then the phone has to check if the encryption matches a success message, then send the success back to the user. As you can see, it is normal that there is a little time before a confirmation message is sent back.

I recommend adding a loading screen in the SKPaymentTransactionStatePurchasing method, telling the user that you are in fact fetching the information. Again, this is 100% normal what you are seeing, Apple has to do a lot of checks, and verify a lot of things before it can send back a confirmation message. Hope this helps!

Are you in the sandbox environment? If so,that is a normal situation.I am in china,it always takes more than 10 second when I test IAP on device.I think it is not your technical issue.Believe yourself.:)

A reason might be, that you are in the sandbox environment, which has occasional hiccups. Or your app could be doing some heavy lifting while performing the purchase, which slows down the device (but runs fast on the more powerful simulator).

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