44

I uploaded my first app to iTunes Connect (iOS 8, iPhone) and it's now available through Apple TestFlight for internal and external testers. I created a Non-Consumable in app purchase for it and would like to test it. How can I add it to my beta app? I'm getting this message in iTunes Connect:

Your first In-App Purchase must be submitted with a new app version. Select it from the In-App Purchase section in Version Details and click Submit.
You do not currently have a iOS Paid Apps contract in effect. If this In-App Purchase was submitted with your app, then your app will not be available on the App Store until your contract goes into effect. Legal, Admin, and Finance users can go to the Agreements, Tax, and Banking module in iTunes Connect to view your contract status.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Tom
  • 5,588
  • 20
  • 77
  • 129

4 Answers4

79

TestFlight users don't require a sandbox account, but they will test against an automatically created sandbox account.

Sandbox Accounts

The moment a tester opens your application, a sandbox account is created for them. This means it's no longer necessary to create test accounts in iTunes Connect. Testing In-App Purchases was never easier.

Source


Note that your TestFlight user is a legitimate App Store user. That user will be purchasing, restoring, etc. from the IAP in the Sandbox as opposed to the real IAP.

On iTunes Connect, the IAP can be "Approved" or "Ready to Submit" (or any other status, I think).

Dan Rosenstark
  • 68,471
  • 58
  • 283
  • 421
  • 3
    Does this mean that we need to validate receipts in TestFlight against the sandbox endpoint? – crockpotveggies Jul 11 '16 at 01:36
  • I have no idea about receipt validation. I only use non-consumable purchases... however, I'm pretty sure the answer is YES, but it should switch your app to that endpoint automatically, right? – Dan Rosenstark Jul 11 '16 at 13:26
  • Yea found out the answer. Basically you have to submit receipts to both endpoints and Apple will return a special code to verify if it's in the right environment – crockpotveggies Jul 11 '16 at 15:07
  • 2
    so your code has to check if it's in beta or in production by trying both endpoints? That sounds slightly terrible by design – Dan Rosenstark Jul 11 '16 at 21:21
  • Literally what Apple recommends and couldn't agree with you more – crockpotveggies Jul 11 '16 at 21:22
  • Does that hold for both internal _and_ external testers? – DrMickeyLauer Apr 27 '17 at 18:48
  • Yes same thing for all testers – Dan Rosenstark Apr 27 '17 at 19:05
  • 13
    Does this mean that we need to validate receipts in TestFlight against the sandbox endpoint? This is a really good question which I found the answer. Hit the production URL first if you receive a error code 21007 that means you need to hit the sandbox URL. Hope this answers the question – iCoder Aug 11 '17 at 08:57
  • 4
    @iCoder Yes, bad sadly this makes testing production builds on Testflight pointless. Because I want to test the real servers, not test servers. – Houman May 12 '19 at 14:45
  • Does this mean test IAP in TestFlight also a sandbox testing, so what is the difference between them? – Zhou Haibo Aug 09 '21 at 05:06
5

English

Testers - TestFlight - Apple Developer

Each build is available to test for up to 90 days, starting from the day the developer uploads their build. You can see how many days you have left for testing in the app’s details page in TestFlight. TestFlight will notify you each time a new build is available and will include instructions on what you need to test.

All in-app purchases are free during the testing period.

中文

测试员 - TestFlight - Apple Developer

从开发者上传的那一天起,每个构建版本可被测试长达 90 天。您可以在 TestFlight 的 app 详细信息页面上查看可供测试的剩余天数。

在测试期间,所有 App 内购买项目都是免费的.

iHTCboy
  • 2,715
  • 21
  • 20
-6

Testing IAP is going to require a test user that you create under iTunes connect. Plus code in you app to implement IAP. Then to test it you "purchase" the item from within the app, under the sandbox, using that user id.

As far as I know TestFlight is no different than testing the IAP on your device by building directly to your device.

I'm assuming that you didn't just add the IAP bundle id and expect it to do something.

If you have not added code to support IAP, that answer is non-trivial within the scope of a SE answer. Google IAP tutorial. There are lots of good ones out there.

badweasel
  • 2,349
  • 1
  • 19
  • 31
  • 3
    this answer mostly just isn't saying anything, but when it is saying something, it is just plain wrong. – eis Oct 16 '18 at 17:49
-7

you can test in-app purchase with test account.

go to itunes connect -> Users and Roles --> Sandbox Testers

then create an account for testing your in app purchase.

when test in app purchase try to logout from app store which uses your real account. then it will ask for itunes account while in testing in app purchase then enter your test account credentials.

Hashmat Khalil
  • 1,826
  • 1
  • 25
  • 49
  • 14
    It should be noted that once Apple approves your first build with your IAP, all purchases will be free for internal and external testers! – Warpling Aug 07 '15 at 20:27
  • 5
    TestFlight don't need any Sandbox tester. You can any account after to test IAP after install app from TestFlight. – LE SANG Oct 03 '15 at 03:59
  • @Warpling that is what I've been trying to find the answer to for a while now. So you'd expect a subscription purchased by a beta user (and marked as paid by my prod servers) would continue on production, and they'd be unable to buy the same subscription again? – user Sep 09 '17 at 23:40
  • 1
    @user purchases actually don't persist on Apple's servers between TestFlight and release unless your app or server maintains a record of what's been "purchased". For example if I buy a non-consumable on a TestFlight copy of an app and then open the release version and try to restore purchases there will be nothing to restore. I'd guess it's the same with subscriptions. – Warpling Sep 10 '17 at 05:46
  • @Warpling brilliant ✨. Your comments are a diamond in the rough. – user Sep 10 '17 at 11:50
  • 1
    @user glad I could help! Testing IAP is essential but very difficult. – Warpling Sep 10 '17 at 21:46