IAP Test

Hi all,

I am a bit confused on the steps necessary for me to setup and test iOS IAP with my corona app. I have an app that has code integrated for IAP. I am able to run the app on the device. I have set up a provisioning profile for installing the app locally.

How do I connect up IAP to be used in a test environment?

I am missing the piece of work that needs to occur for me to actually try testing all this out. Do I need to create a dev sandbox with itunes connect and add the IAP / app?

How / where do I define the IAP purchases?

Any guidance would be greatly appreciated.

-Rick

Hi Rick,

You create your IAP products using iTunes Connect.  That’s where you also set up all of the details about the app as it’ll appear in the App Store, as well as things like Game Center and iAds.  You can create and test all of these things in iTunes Connect before actually uploading and releasing your app.

in iTunes Connect, you’ll also need to create a test user account, which is an option under Manage Users.

Once you have your products and test user account set up, then on your device, go to Settings, log out of your usual iTunes / App Store account, and instead log in with your test account.  Then, run your app and attempt to make a purchase.  Because it’s a development version, it’ll automatically run in Apple’s sandbox mode, and since you’re logged in as your test user, you’ll be able to actually try IAP transactions.  The IAP flow will be exactly like it will be for real users, except that Apple won’t charge your credit card.

Hope this helps.

  • Andrew

Everything Andrew said is right except one thing. Don’t login with your test account on your device settings. If you do this bad things will happen, like your front teeth will fall off, and all your crops will be hit by plagues! So, it’s better not to risk it :wink: Don’t enter anything in the App Store settings, but do log out if you were logged in with your regular account. When you open your app and try to purchase something, a window will pop up asking you to insert your iTunes username and password. That’s when you use your test user account details.

Hi Ricardo,

For me it’s worked either way, whether I log into my test account through Settings or after being prompted during an IAP transaction if I’m not already logged in.  And I still have my teeth and crops.  :-)

I did have an experience once or twice where I was still logged into my test account, and then tried to do a real transaction with it, and I was prompted to start entering credit card details.  It turns out, once you do that, it invalidates the test account, but you can just create a new one to work with instead.  Maybe that was related to my logging in through Settings versus after a prompt, but I don’t recall.

  • Andrew

Thanks guys all good info…so for clarity is the following correct?

  1. I need to add the app itself via iTunes Connect - manage your apps

  2. I can then add the IAP options for the app added above somehow?

  3. I need to create a test account for IAP testing - which I did already

  4. I use the same provisioning profile methodology for test, however, for IAP it knows I am in a sandbox based on the test user login when the IAP stuff runs

When I go to add the app itself how does it know it is not ready for prime time, meaning I am only testing with no intention of distribution at the moment? Is it because the bundleid is my test one?

thanks again…your help is greatly appreciated,

-Rick

Hi Rick,

Yep, that’s all correct.

When you set up your app in iTunes Connect, yes, it’ll know you don’t mean to release it now.  It’ll know that not because it’s a test bundle, but just because you’d actually have to upload a binary to actually release your app.  Try setting up the app in iTunes Connect and I think you’ll find the interface pretty straightforward.

  • Andrew

Great thanks!

Hi Rick,

You create your IAP products using iTunes Connect.  That’s where you also set up all of the details about the app as it’ll appear in the App Store, as well as things like Game Center and iAds.  You can create and test all of these things in iTunes Connect before actually uploading and releasing your app.

in iTunes Connect, you’ll also need to create a test user account, which is an option under Manage Users.

Once you have your products and test user account set up, then on your device, go to Settings, log out of your usual iTunes / App Store account, and instead log in with your test account.  Then, run your app and attempt to make a purchase.  Because it’s a development version, it’ll automatically run in Apple’s sandbox mode, and since you’re logged in as your test user, you’ll be able to actually try IAP transactions.  The IAP flow will be exactly like it will be for real users, except that Apple won’t charge your credit card.

Hope this helps.

  • Andrew

Everything Andrew said is right except one thing. Don’t login with your test account on your device settings. If you do this bad things will happen, like your front teeth will fall off, and all your crops will be hit by plagues! So, it’s better not to risk it :wink: Don’t enter anything in the App Store settings, but do log out if you were logged in with your regular account. When you open your app and try to purchase something, a window will pop up asking you to insert your iTunes username and password. That’s when you use your test user account details.

Hi Ricardo,

For me it’s worked either way, whether I log into my test account through Settings or after being prompted during an IAP transaction if I’m not already logged in.  And I still have my teeth and crops.  :-)

I did have an experience once or twice where I was still logged into my test account, and then tried to do a real transaction with it, and I was prompted to start entering credit card details.  It turns out, once you do that, it invalidates the test account, but you can just create a new one to work with instead.  Maybe that was related to my logging in through Settings versus after a prompt, but I don’t recall.

  • Andrew

Thanks guys all good info…so for clarity is the following correct?

  1. I need to add the app itself via iTunes Connect - manage your apps

  2. I can then add the IAP options for the app added above somehow?

  3. I need to create a test account for IAP testing - which I did already

  4. I use the same provisioning profile methodology for test, however, for IAP it knows I am in a sandbox based on the test user login when the IAP stuff runs

When I go to add the app itself how does it know it is not ready for prime time, meaning I am only testing with no intention of distribution at the moment? Is it because the bundleid is my test one?

thanks again…your help is greatly appreciated,

-Rick

Hi Rick,

Yep, that’s all correct.

When you set up your app in iTunes Connect, yes, it’ll know you don’t mean to release it now.  It’ll know that not because it’s a test bundle, but just because you’d actually have to upload a binary to actually release your app.  Try setting up the app in iTunes Connect and I think you’ll find the interface pretty straightforward.

  • Andrew

Great thanks!