Debug in-app purchase outside of sandbox? - ios

I have an app that uses non-consumable in-app purchases to provide content to the user.
These purchases work fantastically when I run from Xcode (via sandbox) or via ad-hoc builds (for some reason, also via sandbox). It's been approved by Apple and put on the AppStore. But when I download the production version from the store and click the "buy" button it fails.
Seeing as the problem only occurs in production, I'm a bit stymied as to how to debug it. I suspect it has something to do with purchasing through the sandbox vs. production servers, but even ad-hoc is done through the sandbox.
Is there anyway to debug this problem short of adding a bunch of alert dialogs and submitting to Apple again?

You are totally right;
You need all your Contracts (in iTunes Connect) to be active, otherwise you wont be able to make in-app purchases.

Related

How do in app purchases behave in Pending Developer Release?

I recently finished the first version of an iOS application. I have several in-app purchases within it. When testing these, I always used a physical iPhone. Apple just approved the build for release and the app is now in "Pending Developer Release." As one last sanity check, I generated a promo code for myself on app store connect and downloaded the app onto my phone through the app store. I quickly noticed that the SKProductsRequestDelegate method is never fired and the list of in-app purchases is never downloaded from Apple's IAP server. This is similar behavior to when the app is run within a simulator: the IAP data is never loaded.
I am unfamiliar with how the "Pending Developer Release" stage impacts in-app purchases. Will they work as expected when I release the app to the public? Is there some change I need to make and resubmit?
Any help would be greatly appreciated.
As far as I know, it should work seamlessly except for the charging (You won't be charged if your app is downloaded from outside AppStore). So trying to gather logs may help you in this case.
Turns out this was an issue on Apple's end. I contacted support and something on their end had been messed up when they approved the in-app purchases.

iOS - In-app purchases and beta testing

I am about to test my app with my external testers. I will give them a sandbox account to test my in-app purchases. My in-app purchases are hosted with Apple.
My question is, after the testing finishes, I disable app testing in iTunesConnect, I submit my app to Apple, and my app becomes available on the App Store. My testers download my app from App Store. Will the in-app purchases they tested still be there? Will installation from App Store act as a app update?
I tried disabling app testing in iTunesConnnect just now by making it "Not available for testing" and I'm still able to use my app, and test in-app purchases.
If I can't disable my app from testing then testers will get all my in-app purchases that they test for free?
Am I missing something? Can I disable app testing completely?
The app in testflight will last for 30 days from the day of download. After that the app will not be available.
The live version is different and will be needed to be downloaded separately from the app store. It will be a unique application compared your beta app. It would be treated as a fresh install.
Will the in-app purchases they tested still be there?
No
Will installation from App Store act as a app update?
No
will [users] get all my in-app purchases that they test for free?
No
Can I disable app testing completely?
You already have. App will not be available for download. However you cannot remove apps that are already installed. Existing app will last until expiry date.
More info here

How do I avoid paying for my own In-App Purchase?

I've just had an In-App purchase approved and hit the App Store. To check the app, I've deleted my test copy and downloaded fresh from the App Store - but now I can't get the In-App purchase without paying for it. Is there a way around this? Sandbox user isn't working in the real App Store, and I don't want to make the In-App purchase free, even for a short while, during the first few days of update. Promo codes are available for the app, but not the IAP.
You can use the below link to create sand box users and test app without paying for it:
https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnectInAppPurchase_Guide/Chapters/TestingInAppPurchases.html
I suppose it is not possible to test (without paying) IAP once app is in app store. For this purpose sandbox environment is provided by apple so that IAP are tested in development.

After removing application from Apple AppStore, will restoring of in-app purchases still work?

I'm going to remove my paid application from AppStore and wonder if in-app purchases will still work, or if they will be removed also. Are there any legal issues in the case if they will not be available anymore?
If you remove your app from App Store your in-app purchases are still valid and remain in approved state. So lets say you decide to put your app back in App Store then you don't need to do anything special with in-app purchases. They will be available and working.
Any existing user who had downloaded your app previously will be able to make in-app purchases. All you are doing is not letting new users download your app.
NOTE: as long as you don't "delete" your app or in-app purchases and you just make your app not available in any store / country, you should be fine.

iOS In App Purchase: test a real purchase without submitting to Apple

I implemented in app purchase in my iOS app and I want to do a real test (not a sandbox) before submitting this new version to Apple
Of course, the current version of the app (in the App Store) was validated with a product
So, I archived the app using an Ad Hoc distribution profile and I generated an IPA file for Ad Hoc deployment. But when I installed the app via Testflight on my device, I discovered that the app was in sandbox environment!
Is there a way to do a "real" purchase before submitting the app to the App Store ?
You can actually test the in-app purchasing in the sandbox environment, basically you'll need to set up an test user account in your iTunesConnect.
Check the apple documentation here:
http://developer.apple.com/library/ios/#technotes/tn2259/_index.html
You'll be able to find all the information related to In-App Purchasing, including sandbox testing.
Short answer: you can't test a real purchase (aka, spend real money). It isn't possible.
Slightly longer answer: You'll automatically hit the sandbox environment unless it's an apple-signed release build. Even ad-hoc signed builds hit the sandbox.
To test a new IAP: create your IAP (it will be in "needs approval mode" until submitted with the final build and test against the sandbox - that's fine). If your purchase works against the sandbox, it should work against prod with real money as well. It would be great to do a trial run with real money, but that's just not possible until the IAP is approved and you get the production signed version of the app from the app store.
Just create a test account on iTunes Connect. Then log out from the device and run your app from Xcode.
To get access to the purchase you need apple signature, because you are connecting with the apple servers.
I assume that your app, is doesnt have that signature, so your request goes to the sandbox.

Resources