I'm getting nuts with this error. Please have an EXACT look at the error message! It's "SSErrorDomain" NOT "SK..." in combination with code=0. I wasn't able find anybody with the same issue anywhere on the net so far. People seem to have either SSErrorDomain with code=2 or SKErrorDomain with code=0. My combination was nowhere described and nothing helped so far.
Ok, here's what I try: App is working fine without in-App since 1st January it is available on the store. Now I've added In-App purchases to my App. I try to test them but all I get is the above error. It does not even try to ask me for a test user or anything.
I'm absolutely sure, I'm logged out of the store, working on a real device and did all the other tests (many times) that I could find on the net. Nothing! Still "Cannot connect..."
I've checked all things described here Ray Wenderlichs In-App Tutorial. I've even created a new App from scratch with his tutorial. Same Problem. Waiting for several days didn't help either.
I've done the things described here Cannot connect to iTunes in Baker Factory. You can guess the result.
Here's some code. Just the start which is called in viewDidLoad()
:
internal class InApp : NSObject, SKProductsRequestDelegate, SKPaymentTransactionObserver {
private var request: SKProductsRequest!
// Start communication with Apple Store to retrieve list of available products
internal func start() {
if let url = NSBundle.mainBundle().URLForResource("InAppProducts", withExtension: "plist") {
if let productIds = NSArray(contentsOfURL: url) {
NSLog("InApp: Product-Id \(productIds)")
SKPaymentQueue.defaultQueue().addTransactionObserver(self)
request = SKProductsRequest(productIdentifiers: Set(arrayLiteral: productIds))
request.delegate = self
request.start()
NSLog("InApp: request started")
}
}
}
The log prints the two product id's, read from plist, correctly. The log also shows the "request started". After that it calls directly the error routine:
internal func request(request: SKRequest!, didFailWithError error: NSError!) {
NSLog("ERROR: decription: \(error!.description), reason: \(error!.localizedFailureReason), options: \(error!.localizedRecoveryOptions), suggestion: \(error!.localizedRecoverySuggestion)")
}
I'm using Xcode 6.3 and an iPhone 6 with iOS 8.3. GameCenter iAdBanner and all other features work perfectly.
Any any any suggestions, where I could look at and what I could do, are highly welcome!