unity iap purchase fails before the user confirms purchase
Hi there,
Been trying to swap prime31 iap plugin with unity iap purchases for couple of days. The app is live, meaning that all the itunes connect configuration is right. After I made all need code for initialization, product query and stuff, I've got this weird behavior.
User selects a product to buy -> we send InitiatePurchase to unity iap -> user prompted with a window to enter his apple password -> after right password, unity fires purchase failed event with unknown reason -> user is prompted with apple's native confirmation window ("you sure you want ot spend your money?") -> clicking any button closes the dialog, but no iap callbacks fired.
Unity 5.5.2p2, iOS 10.2.1
There's not much information unity provides me what could be a problem, so maybe somebody encountered the issue and could share some knowledge on the problem.
Cheers, Vlad
Answer by janseng · Mar 31, 2017 at 12:14 PM
I have encountered the same problem, and now it has not been resolved, but I have some clues here may be useful to you。
Find the file in the project
Locate this code snippet and print out specific errors with the log
Then run the program to try to use the in-app purchase, carefully observe the log
UnityIAP:PurchaseFailed: Error Domain=SKErrorDomain Code=0 "Cannot connect iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect iTunes Store}
Hope that these clues can help you
http://stackoverflow.com/questions/2359739/iphone-store-kit-cannot-connect-to-itunes-store
This is a really good hint! thank you very much! It would be nice to know what was your problem and solution though :)