I am trying to implement开发者_开发知识库 in-app purchases in my application. I have implemented it as per Apple's Programming Guide and the code was working fine until I created a new application, App ID, provisioning profile and in-app products @ another developer account. Now, it gives me following error.
Error Domain=SKErrorDomain Code=3 UserInfo=0x2a5a00 "Cannot connect to iTunes Store"
The same code works fine if I use previous developer account's appid, pro-certificate and product ids. This is a very strange issue, I double checked product id names and other things still facing same error. Any clue..?
Update: Check out this post and add your complaint so apple will get a move on fixing this issue.
iPhone storekit sandbox stopped working
Close to the same thing here - Using iPad
I had my inApp purchase working. It was fine, did everything it was supposed to. Then I started getting the Error Domain=SKErrorDomain Code=2 UserInfo=(someHexMemoryAddress) "Cannot connect to iTunes Store"
Read on one post to reset all content and settings -- Did that and didn't work.
Tried creating a new Test User in iTunes -- Didn't work.
Made sure my Code Signing Identity in the Project Build Settings was set to the correct Profile that was created with all the inApp stuff. It actually wasn't, and was somehow set to any compatible Profile. I changed it to the correct profile. This didn't work either though.
Still having the same problem.
Between the time it was working and then not working, the only thing I really did was implement Facebook Connect. One interesting thing there is the delegate method -
- (void)request:(FBRequest*)request didFailWithError:(NSError*)error;
which also gets called as a delegate method to SKRequestDelegate. I don't think this is causing a conflict because it is only getting called when there is an error.
I am still able to contact the store and get a list of available products. When I send a purchase request I get a response telling me- You've already purchased this In App purchase but it hasn't been downloaded. I click ok and then I get the Error Domain=bla bla bla .
Interestingly, I did get the dialog about previous purchase even when purchasing the item for the first time with the new test user I created.
Another thing I learned is this, IF you made the Test User, and then Signed In in the Settings App, and it asked you for a credit card, it wont work.
You need to - 1. create a new Test User, 2. sign out of all accounts in the Store settings. 3. Then go make make a purchase IN your app and it will ask you to log in with existing user. 4. Log in with the new Test User you created and it will work.
Before you start to test read you should read this technical note: http://developer.apple.com/library/ios/#technotes/tn2009/tn2259.html item: "What's Next?" point 11.
Another possible reason of this behavior of iTunes server is unfinished transaction for this product. You cannot buy product again while previous transaction is not finished.
Best Regards, Vadim
I had an error similar to this. The issue was 1. not having a provisioning profile setup that could handle in app purchases 2. not having created the app profile in iTunes Connect 3. not having created the in app purchase items in iTunes Connect
After I setup the above 3 things and used the new provisioning profile when signing the app I was golden.
In my first in-app-purchase app O was also getting same error BUT with Code=0.i.e.
Error Domain=SKErrorDomain Code=0 UserInfo=someHEXno "Cannot connect to iTunes Store"
I tried to solve the connecting problem for hours.
But main problem was my productIdentifiers name i.e. I had written:
SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:@"productnameID"]];
but the "productnameID" was wrong. After giving right productnameID program was still showing same error
Error Domain=SKErrorDomain Code=0 UserInfo=0x2a5a00 "Cannot connect to iTunes Store"
Yet it was running properly and show alert box for purchase.
I had the same error as iPhoneBuddy in my app:
Error Domain=SKErrorDomain Code=0 UserInfo=0x2a5a00 "Cannot connect to iTunes Store"
Thanks to user495729 answer I solved the problem!
http://developer.apple.com/library/ios/#technotes/tn2009/tn2259.html
2- Test your application in the sandbox environment. iOS developers must complete the following steps: Sign out of the Store in the Settings application on your testing device. Set the run destination of your application to an iOS Device in Xcode. Build and run your application from Xcode.
In your device go to "System -> iTunes & App Stores", click on your Apple ID and Sign Out. Now run you application and test your IAPs, login with your Test User.
If you don't have any Test User created go to "iTunes Connect -> Manage Users -> Test User -> Add New User" and you are Ok!
精彩评论