Bug reported as fixed by Apple, see accepted answer below ...
UPDATE MON AUG 23rd 10:00 GMT
Although the bug report with apple hasn't been closed yet, it now seems to be working (at least for a couple of us) OK. It could be they have nailed it, or the fix is in testing, and I'll report back when (if) I hear anything more from Apple.
UPDATE FRI AUG 20th
Just to say I've had an email back from Apple Engineering (21:20 GMT) and they have said:
"Thank you for reporting this. We're aware of this issue and are开发者_如何学C currently working on a fix."
So hopefully there will soon be a resolution!
[ update to question below. There definitely seems to be a storekit sandbox issue at present. I've seen 4 or 5 other people report the same fault, but would appreciate a larger sample size! If you have a storekit implementation that you can test in the sandbox if you could report whether or not it works for you that would be much appreciated. I've logged a bug with apple as bug id#8329461 but am not sure how else to expedite this or if it is really a widespread issue. ]
I have a working iPhone storekit implementation in development. All the items for purchase are consumable, we have multiple test accounts established.
All of a sudden today, my sequence goes;
1) Request product list from Apple ... works fine (so can connect to store OK)
2) Purchase item - get "Confirm your In App Purchase" alert as normal
3) (click buy)
4a) My code gets a failed transaction with error code 2 and description "cannot connect to itunes store" via the - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions method.
[[SKPaymentQueue defaultQueue] finishTransaction: transaction] is being called in this situation.
4b) The user gets an alert "You've already purchased this but it hasn't been downloaded" (it has never been purchased on this device with this user account).
This is happening on different devices and with test accounts that have never been used before. I'm not aware of any changes to our code. Can anyone else confirm that the storekit test framework is working correctly for them? Is anyone else having issues today?
Any ideas as to what causes this strangeness? The message "cannot connect to itunes store" seems odd given it clearly can for retrieving product ids and watching the transaction.
NB. I also note that setting up test user accounts in the store has changed - there are now stricter password requirements etc and so I'm wondering if Apple have changed something that might be causing the issue.
TIA Roger
PS. On a first attempt on a new device, I get the alert "unable to connect to itunes store try again later" but then what happens is that the device thinks it has already been purchased so gives the message about downloading again.
Just had a final update from Apple closing the bug.
This is a courtesy email regarding Bug ID# 8329461.
Engineering has provided the following feedback regarding this issue:
We believe this issue is now resolved. Please let us know if you have any problems.
I've also been plagued by this problem. I had a fully functional In App Purchase working fine. I later uploaded a new binary and approved it. I made some other changes to the app, and also used a foreign "IN APP" purchase User, attempted to sign-in in Settings. Later when I tested it again, itt was no longer working. The error I got was "Unable to connect to iTunes", "Error Domain=NSURLErrorDomain Code=-1009". Pulled lots of hair out. I was able to fix it by signing out of iTunes account on the iPhone, "cleaning all targets", AND also signing out of iTunes on my MAC, (I closed iTunes), creating a new "local" In-App" user (necessary?). Attempted to sign into that account on my iPhone. Then it started working! Some of the above may be voodoo, but it worked. Hope this helps a few people.
I am also having the same issue. As of a couple days ago it seems. I am on iPad. Exactly the same description as Roger wrote.
Tried the Erase All Content and Settings on the iPad. Didn't work. Tried on several networks. Seemed like at first I was having a real slow connection. Took a long time to get a response from the store with the product info. As of today, I am connecting very quickly to the store but still having the same error after being notified that I have already purchased the product. Created new users, everything. No go. I've gone through all the code and it looks fine. Definitly seems to be a problem with the Sandbox side. Hope to see an update on this thread soon.
Edit
For now I am just skipping the purchase request and calling my provideContent: method when when choosing to make a purchase. Since the store is still providing me with the products, I can keep testing and working on the content providing aspect but it sure would be nice to get this working.
After announced "fix" by apple still have this trouble. It's feels like purchase transaction just falls off while test user input his credentials. But when test user is already logged in, everything is OK.
Either [SKPayment paymentWithProduct:product] nor [SKPayment paymentWithProductIdentifier:product.productIdentifier] works with logged out user in spite of products request was successful.
Does anyone have any workaround?
I've been going nuts over the same issue all morning in Lion and MacOS (not iPhone). The sandbox is not working.
I just got "An unknown error has occurred" when trying to make the purchase and a console error like this one
8/23/11 1:12:26.090 PM storeagent: promptResponse: <CKSignInPromptResponse:0x7fe1c14fb2a0 returnCode:-1>
If there is another poor soul like me out there that has been burning their brains out for hours to make this work I just found the answer: the in-app purchase sandbox is ONLY working for US test users. Other stores are not working (my test user was set to Argentina...). Create a new Test user, set it to the US store, and it will work...
I hope this helps.
For anyone having an issue similar to: "Cannot connect to iTunes Store" make sure to log out of your Apple ID in the iTunes & App Stores in settings and to try using a test account attached to your iTunes Connect account with access to your app and in app purchase
精彩评论