Reputation: 2302
I'm trying to test in app purchases in our app but I'm not having any luck. Part of the problem may be due to the expected sequence not being documented anywhere. Here are the steps I followed to support in-app purchases:
Here is where my understanding of what is the expected behavior is deficient. Here is what I see at this point:
Q1: What exactly should I expect once I enter the test user email address and password (the first set of steps)?
Q2: Why am I being asked for all this extra information for a test user? What should I be looking at to troubleshoot this?
Thanks for your help.
Upvotes: 24
Views: 11141
Reputation: 18922
I was able to get around this issue by signing my test user into a different app that I was developing, then going back to the app where I was having problems (no amount of deleting or restarting helped). As others have said, you don't want to be signed in as the test user in the Settings menu when you try to perform your IAP.
Upvotes: 0
Reputation: 2426
It happens when you install your development application over downloaded from App Store. To fix this issue, you need to remove application from the device and install fresh copy using XCode. iOS caches distribution profile somehow and requires production user if the first installation was done through App Store. With no regard what installation method was used recently.
Upvotes: 30
Reputation: 4348
This sequence worked for me. I tried all of the above sequences and they failed for me.
Thanks to OmegaDelta's blog for this one: http://omegadelta.net/2011/05/11/testing-in-app-purchases-in-ios-4-3-sandbox/
Upvotes: 10
Reputation: 1038
None of these answers is very specific or wholly correct, and the in-app behavior has changed slightly over the past year wrt test accounts. The true/current solution to this if you hit it: go through the review/sign-in pages in iTunes for the test account and just "cancel" from the "enter billing information" screen with no harm, no foul. If for whatever reason you never get prompted to review/sign-in, then don't bother to do so.
Upvotes: 1
Reputation: 111
Here is the trick (at least if worked for me..).
First log out of your real iTunes account in Settings > Store > Apple ID. You must be logged out of an account to be able to use your test account.
However, don't log in to your test account on that screen.
Go to the app, initiate your in-app purchase, and enter the test account email and password there. Assuming the test account is set up correctly (!), that should work.
Then, when finished testing, go back to Settings > Store > Apple ID and log out of the test account.
Upvotes: 11
Reputation: 3372
I've experienced the same problems until I quit iTunes and installed the right provisioning profile to my device. Running iTunes with Xcode restored my account from time to time so even when I log out on the device I was suggested to use my (not test) account in the app. Installing the correct profile fixed the second problem.
Hope it can help somebody too.
Upvotes: 1
Reputation: 2302
I found some answers to my questions above after I completely deleted the app off my device and tried again. I have no idea why that was required.
Q1: What exactly should I expect once I enter the test user email address and password( the first set of steps)?
No addition questions are asked once entering user credentials if it works, so if the first alert in the second list is displayed then you know it didn't work.
Q2: Why am I being asked for all this extra information for a test user? What should I be looking at to troubleshoot this?
The only thing I can think of is that there was something cached in my app from previous requests. This makes me nervous as I have no idea whether customers will have to delete the app or not like I did.
Upvotes: 5