Opinion seems to be split on whether an app binary is required to be uploaded to iTunes Connect before a testing an in-app purchase. I've created the app (no binary uploaded yet), created the in-app purchase, enabled by App ID for in-app purchase and marked the purchase "available for sale". I've followed the instructions in the guide as far as I can tell.
However, when I try it on my device I am unable to retrieve the products - SKProductRequest returns my request product as invalid.
Any suggestions what I need to do?
Does the in-app purchase product need to "Developer Approved" for this to work?
Any definitive answer on whether a binary needs to be uploaded? I would like to avoid that if possible but am willing to do it if required.
Well, actually I just had a similar issue that was solved only AFTER uploading a binary and rejecting it, so I am not sure that the answer above is correct. Would love to hear something from Apple about it as it is the second time this happens to me.
Binary does not need to be uploaded. Source: my current in-development app.
I am getting my test in-app purchases without uploading my binary, and without setting the purchase to be developer approved. I followed the instruction included in the docs to set it up.
Have you been testing on the device? in-app purchases do not work in the simulator. Perhaps if you posted some more info we could help a little bit better.
This is my method... I usually get caught because I miss step 3:
Step 1
Create your IAP's
(I won't go throught that in detail... unless someone wants me too.)
Step 2
Edit In-App Purchases
Select In-App Purchases for review with this app version. The In-App Purchases shown will be ones in the Ready to Submit state.
Step 3
Re-generate your dev & dist certificates in apple developer.
Site 4
Install the certificates from step 3. and ensure under Xcode's Code Signing you do this:
- Set both debug & release setting to Don't Code Sign
- Then assign with your new certificates.
Step 5
Clean and rebuild in Xcode and your IAP's should sandbox on your test devices.
Good luck!
This question is just a bit dated, but working through the Ray Wenderlich IAP tutorial (found HERE) confirms how one goes about testing IAP without uploading a binary.
Related
Issue I am facing is this below:
"We found that your in-app purchase products exhibited one or more bugs when reviewed on iPhone running iOS 14.2 on Wi-Fi."
"When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Appleās test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead."
I have implemented in-App Purchase (Non-Consumable), Its working perfectly fine in Buy and Restore etc. Apple Rejects with the above reason.
What I am doing:
Using SwiftyStoreKit
Click Buy Button
SwiftyStoreKit.retrieveProductsInfo
SwiftyStoreKit.purchaseProduct
On Success ( SwiftyStoreKit.finishTransaction )
Restore:
Click Restore
SwiftyStoreKit.restorePurchases
Please let me know if need more information or code etc and what I am doing wrong which rejected the app.
Apple Recently Replied me as well this below message:
"Regarding purchasing in-app purchases, we continue to be unable to buy the full version of the app. When we tap on the button to buy, the app continues to load indefinitely.
We are not able to provide feedback on app concepts or features, but we recommend evaluating your suggestions against the App Store Review Guidelines, as well as the iOS Developer Program License Agreement (PLA), and the iOS Human Interface Guidelines."
So I found the Solution for this. When ever you receive error something like above, here are the steps you need to check and do.
Check first your In-App Purchase Implementation. Are you doing it correctly, ending the transaction etc.
Check what is the latest version of iOS supported by your XCode. If its lower than the shown in the issue like in mine ( xcode ios version was 14.0 and issue with 14.2).
For that you need to just download the latest XCode which support that iOS Version and make a build and then submit for review. It will surely work.
So I'm testing out an in-app purchase in my app. I've got the code set up properly and everything, but when I do attempt to buy or restore in the sandbox environment, I get this error:
MZCommerceInAppBuy.App BuyInfoDataAccessFailure_message
[Environment: Sandbox]
I've never seen this before, and I am finding only one Google search result from someone else who has. It never was solved. Has anybody seen this?
I figured out a solution. The problem was coming because I was adding an in-app purchase to the current live version of my app. I created a new version of my app and changed it on my target to the update version.
I also downloaded a new development provisioning profile. I'm not sure if this is necessary, but I wanted to add that I created a new one just in case.
When you add in-app purchases to an app, you must create a new app version even for testing.
Note:
Just a side note. I noticed while I received this error I also wan't receiving any in-app purchase products. You will not receive any products until you create the new version.
I am trying to submit my first iPhone app that has in-app purchasing features. Needless to say, I have been banging my head against the wall for a while. I have read through several tutorials, such as: http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/ and http://blog.mugunthkumar.com/coding/iphone-tutorial-%E2%80%93-in-app-purchases/ but it seems these are outdated? For instance, I can't find where the developer is to reject the submission on iTunes connect.
Additionally, I am submitting the app the in-app purchase features included in the bundle(I don't have them stored on the server- I just want to unlock the code when the user purchases the feature). What is the best way to do this?
Thanks!
Some of the information in the linked tutorials is in fact outdated: I could create in app items in iTunes connect without having to submit (and reject) a binary first. Just be sure NOT to submit your items for review while you are testing. Also changes to the items (e.g. price tier) have been processed almost immediately and I did not had to wait 24 hours.
To unlock your feature, you may use storing and retrieving the purchased status in NSUserDefaults . But this could easily be tempered with by users with jailbreak or acces to the apps folder. Have a look at http://maniacdev.com/2011/08/open-source-ios-keychain-wrapper-for-easily-securing-user-data-for-your-app/ . This offers a simple way to store data in the keychain. Still this will not prevent someone to 'hack' your app and enable the purchased feature without actual purchase, but it's not that easy...
In-App Purchase development is definitely a pain point in iOS development - their sandboxing model for this is ridiculous.
Needless to say - the articles you're reading are still up to date. The developer reject is definitely the way to go (I think can do from within the binary details). One thing to remember is that you need to have accepted the appropriate contracts and tax schedules also - if you haven't then the store "just doesn't work".
One thing that caught me: when you submit your final version of the app - make sure you tick the in-app purchases to be included; else the in-app purchases won't be reviewed (and accepted)!
Update: Although it's pretty long... you may want to flick through this: https://itunesconnect.apple.com/docs/iTunesConnect_DeveloperGuide.pdf
Explains how to developer reject etc.
I'm trying to implement in app purchases in my App using MKStoreKit. I've followed all the steps and I'm getting the error:
Problem in iTunes connect configuration for product:
I've recreated the provisioning profiles, checked the product id is the same as in itunes connect, sent and rejected a binary, trying to delete everything and set it up again and nothing is working.
Any idea?
I know this is a late reply, but somehow I could not find the answer to this problem elsewhere so I decided to post my experience in hopes it might help other frustrated people with this issue.
I have recently added an In-App purchase to my Free app and I faced the same problem during the testing phase and also once it was launched on App Store.
The answer is Patience. For some odd reason, after doing everything correctly, you need to wait for around a day before your product is recognized. So once you finish your Manage In-App product ID, you will only see it working the following day - so don't delete and recreate it again - just wait.
Furthermore, after submitting your app for approval with the first In-App product, even when your app is approved and available in the App Store, the In-App might not work at first and you will feel you did something wrong. Wait another day or so, and magically, it will start to work.
It didn't work in my case cause the phone was jailbroken. After restoring it worked like a charm.
my ipad was jailbroken. it was given this "Problem in iTunes connect configuration for product: xxx" i changed my ipad with regular(no jailbrek) ipad and it's working now.
My in app purchase project working perfectly now, but I need to test purchasing and when once purchase is successfully done it cannot be undone? How can I test in app purchasing and upgrading my app to full version when it can be done just one time?
Delete the app from your device
Run "Clean" from the Product menu in XCode
On your device, go to "Settings", "Store", "Apple ID", and Sign Out
Start your app again, since you're not signed in to any account, the previous in-app purchase will not be recognized and you'll be able to buy it/download it again with the same test user account
None of the answers is really correct. Even if the you remove the cached purchase from your testing device, the product is marked as bought in Apple's server, associated to your test Apple ID. So the testing will not exactly reproduce the expected behavior. This is very important for testing the restore products function use cases, for example.
As far as I know, the real answer to this question is: You can't without creating a new test account, but that's not a really big deal, you can even use an invented email address (no need to validate it), and you can delete the account after using it.
If you delete your app and reinstall it, you can repurchase products. It follows the same code flow and nearly exactly the same user experience (there is a dialog letting you know that you can repurchase for free the second time). Also you can create more test users in iTunes Connect to be sure that you are doing completely clean testing.
I've spent several weeks deleting and reinstalling my app many times per day to ensure that my storekit implementation works just like I want it too.
All you have to do is delete your app from the device. This will wipe out any NSUserDefaults where you may have stored in-app purchase details.
Once you run your app again, make the purchase one more time, and Store Kit will tell you this:
"You've already purchased this. Tap OK to download it again for free"
Once you tap OK, you go through the same sequence of events you did when you made your first in-app purchase, so you can test again and again.
Use unit tests on your app, with false data, until you're satisfied.
(create test code - for each module you use)
I think I'll need more description of your process to have a better answer.