Does my app have to be approved in the app store for me to test in-app purchases?

I’ve registered my app in the store but because I’m still very much in development I have not uploaded a binary yet. I’ve created 4 iAP’s to purchase as consumables, but while store.init() works, calling store.loadProducts does not return any valid products.

Is this because my app does not have a binary uploaded yet?

How do we test iAP’s without having an approved app in the store?

You don’t have to upload the binary in order for IAP to work.

I always create the IAP products, create an adhoc build, and switch to a iTunes test account on the iPad to test IAP.

Make sure you initialized the IAP with the correct product_id, and you have activated the IAP in the app details section.

Thanks,

How do I create an iTunes test account (I’m assuming this is an account which won’t get charged real money every time I attempt to buy an iAP?)

How do I activate the iAP details? iTC keeps telling me that I have to attach the iAP products to the uploaded version.

In iTunes Connect, click Manage users, then click Test User.

Manage your app, click app icon, click Manage In App Purchases.

Add IPA, fill in all the info, and upload a screenshot for review. That’s a screenshot the user will see after the purchase. I always display a message box, with Thank you for purchasing blah blah.

Then, edit details of your app, and somewhere on the bottom you can select/activate your current IAP 

Thanks - creating the test user appears to have made it work, though only in the Apple Sim and device, of course.

Btw, for the completed purchase message, do you think it’s appropriate to use just a simple native.showAlert() or do you need a designed box?

I always us a native.showAlert()

I can’t seem to make a purchase - I’ve created an adhoc certificate, identifier and provisioning profile and installed on device. It keeps telling me that it can’t connect to the app store.

You need to go into settings->app store and log out of your real account first, then run your app.

Yes, I did. Should I create an ad hoc provisioning profile for my developer certificate? Also, is it really necessary for apple to ask for real CC details on a test account?

Yes testing iap can be very annoying.

Here are some rules i use:

I think you can’t use this kind of adhoc profile ( com.yoursite.* ) you need a fixed development profile like this com.yoursite.yourapp.

When making a test user account you have to wait a couple of hours before using it.

Remember to log out of the store in settings and don’t go to the CC details page. It vil invalidate your test user account.

If you see the CC page something went wrong.

Another useful tip is you can create multiple test users on the same email address in iTunes connect. 

If your mail is for example: john@doe.com

you can create multiple test users like this:

john+uk@doe.com

john+us@doe.com

and so on… then you can test iap in different countries with one email address.

He store on my ipad does not want to let me login without validating the test account CC details…

Am I missing a step?..

I create a test user in iTunes Connect and then attempt to login on my iPad under Settings->iTunes & App Store

I get an alert saying “This Apple ID has not yet been used in the iTunes Store. Tap Review to sign in, then review your account information.”

If this is a test account, am I simply not waiting long enough for the test data of the account to filter to my locale’s Apple servers?

That means something went wrong. You will never see that CC dialog if everything is setup correctly.

Try creating some new test user accounts and wait some hours before using them.

Don’t log in with your test account under settings.

Instead Log out in settings. Open your app and try to buy with iap. Then log in with your test user via the dialog in your app.

It doesn’t work if you log in in the settings.

This is from apple. Maybe it is easier to understand :slight_smile:

Follow these steps to test your application in the sandbox.

Log out from your iTunes account on the test device.

Before you can test your application, you must first log out of your regular iTunes account. To log out of your iTunes account, exit your application, launch the Settings application and click the Store icon. Sign out from the currently active account.

Important:  Do not sign in with your test account in the Settings application.

Launch your application.

Once you have signed out of your account, exit Settings and launch your application. As you make purchases from your application’s store, Store Kit prompts you to authenticate the transaction. Log in using your test account to approve the payment. No financial transaction takes place, but transactions complete as if a payment was made.

So, just to double check with you, testing iAP requires:

Certificate: Development

App ID: Team prefix, non-wildcard ID

Provisioning profile: Distribution, ad-hoc

Sign out of app store in Settings on the device and only sign in when attempting an iAP purchase in the development app.

Don’t try and login to the app store with the test account.  Just run your app.  It will prompt you for the username/password of the test account.

You can use a development provisioning profile for testing as long as the app id is not a wildcard id.

You don’t have to upload the binary in order for IAP to work.

I always create the IAP products, create an adhoc build, and switch to a iTunes test account on the iPad to test IAP.

Make sure you initialized the IAP with the correct product_id, and you have activated the IAP in the app details section.

Thanks,

How do I create an iTunes test account (I’m assuming this is an account which won’t get charged real money every time I attempt to buy an iAP?)

How do I activate the iAP details? iTC keeps telling me that I have to attach the iAP products to the uploaded version.