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

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.

Sorry to re-invigorate this thread after so long, but my app id is “com.mattsco.simplegame.dev” Does the prefix matter?

I have signed out of the app store in Settings, rebuilt my app and tried again. The store init seems to show that my iAPs are all invalid. I have checked in the iTunes Connect app iAP setup and get the message "We have returned your IAP product/s to you as the required binary was not submitted. When you are ready to submit the binary, please resubmit the IAPs with the binary. " So, do I have to upload a binary to get the iAP’s to work?

Apple keeps changing their rules on this.  Currently it appears you need to upload the binary, then reject it.  It might help to have some time elapse to get the IAP items approved. 

Rob

That’s what I was thinking previously. It is strange. Do you think there are any requirements of the binary, such as it must have a reference to the products? How would Apple check that? More specifically, do I have to upload a store-ready binary or just a developer build? I’m nowhere near store ready, as yet.

I know Google Play looks to make sure the currently uploaded APK file has the Billing permission.  So in their case, you just have to upload an “Alpha” build to test.  Amazon just has to have the products submitted and approved and they test through a different tool.  But for iOS, it seems that while Apple could scan for the presence of some SDK’s (like they do to generate the push notification warnings) but I don’t believe they do. I’ve seen no evidence of it.

Rob

Well, now I have the app submitted and waiting for review. The iAP items were created just before submitting the binary and are ready to submit. Should I reject the binary and submit the items? Should I submit the items and then reject the binary? Should I just leave it as it is and wait?