Lavvo
Lavvo

Reputation: 1024

Testing In-App Purchase on iPhone

I have setup my app to use In-App Purchases. All the necessary steps have been done and everything works except for one thing, the final step for completing the purchase transaction i.e. SKPaymentTransactionState always completes with Failed every time.

So I did some research and found another post that said not to test this in the simulator and do it on a physical device as it seems there is a limitation placed on making purchases in the simulator by Apple on purpose.

So I went back to try to run this on my physical iPhone instead. The problem I'm having now is that my physical iPhone is linked to my active iTunes account. When I try to make a purchase on it, the User ID is already defaulting to my active ID and it only asks for my password.

So my question is (1) How do I force the phone to ask for me to enter a new User ID and Password so that I can use the Sandbox User I created in iTunes Connect? (2) I am a little nervous about even entering a secondary iTunes credentials, can anyone validate what the behavior is like? I do not want my active iTunes account to have any issues, it is possible to run both my active iTunes account and the sandbox user on my physical device with no issues?

Upvotes: 0

Views: 140

Answers (1)

Brad Brighton
Brad Brighton

Reputation: 2184

Log out of iTunes on the phone via Settings, but wait for the app to prompt you to log in before entering your sandbox account credentials. NOTE that I'm referring to iTunes, not iCloud. It gets more interesting if you need to do that.

When you're done testing, log out again via Settings but differently than before, go ahead and re-log in via Settings to your "regular" Apple ID to return to production use.

You can't run them "simultaneously" as such but you can use your regular device to sandbox test without problems.

Upvotes: 1

Related Questions