I keep finding conflicting information about whether In App Purchases can actually be tested on a simulator using Xcode 6. Some answers say 'yes', others seem to indicate there are a bug in beta versions of Xcode 6 and others flat out 'no'.
I have an app where IAP works great on the device, but in the simulator, trying to refresh the receipt fails with a very unhelpful message: Error Domain=SKErrorDomain Code=0 "The operation couldn’t be completed. (SKErrorDomain error 0.)"
.
My app was rejected from the app store because the tester could not test (even though it works perfectly with sandbox accounts on devices) and I am beginning to suspect that they simply tested on a simulator and were not able to proceed.
Since I had read so much about it not working on a simulator and that you had to test on a device, I didn't worry about it not working on the simulator but that may have bitten me in the backside.
Can anyone say that they have actually gotten IAP to work on IOS 8 / Xcode 6 simulators?
It is impossible to make a purchase on a simulator (it is only possible to request a list of available purchases). To test purchases, you first need to set up products on App Store Connect and then use the user's sandbox environment and a real device. In this case, purchases for the developer are free.
Sign In to the App Store with Your Sandbox Apple ID In iOS and iPadOS, the sandbox account appears in Settings > App Store after the first time you use the device to attempt a purchase in a development-signed app. There's no need to sign out of the non-Sandbox Apple ID.
In the Xcode Project navigator, select the StoreKit configuration file. Choose Editor > Enable Interrupted Purchases. Run the app in the simulator or on a device. In the app, buy an in-app purchase.
Most of the StoreKit sandbox does mysteriously now seem to work when using a debug-build iOS 8 target in the Xcode 6 simulator.
You can't buy an auto-renewing subscription though. You get as far as the final confirmation dialog but after that the transaction always comes back with a transactionState
of SKPaymentTransactionStateFailed
. Same code works on the device. I reported this on Radar, but Apple replied that StoreKit is not supported in the simulator, which is weird given that it does all seem very close to working.
Actually, i have been tested in-app purchase in xcode 6 / iOS 8 simulator and it just work perfect (sandbox purchase and restore). However the other simulators (iOS 7.0.3 and 7.1) was not work for IAP.
So, the answer is yes.
Does your app contain verification methods for IAP receipt ? May be it is seemed too simple but are you sure that the verifications control not with https://sandbox.itunes.apple.com/verifyReceipt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With