I'm trying to add my first in-app purchase to my iOS application
It's state in iTunesConnect is "Missing Metadat", but the only thing I didn't send is the screenshot for the review (I expect to see "Wiating for screenshot" instead of "missing metadata"). I also specified the localization name of its group
The thing is that in my application, my productIdentifier appears in the invalid products, and I don't know why because it seems for me that everything is fine.
I disconnected my AppStore account, My AppID and my signInProfiles have In-App Purchase checked in the capabilities, XCode does not show any error in the project's settings, I have a sandbox user on iTunesConnect.
I really don't understand what to do to make things working...
Note : A few months earlier, I managed to have an In-app product and I was able to test it on my application in the development state. We didn't submit it to the App Review and I had to delete it from iTunesConnect.
I found the source of my problem
I apologize because I totaly forgot to talk about it, but I work with 3 stagings of my application : Production, Integration (i.e BETA), Development
And to be able to have all 3 of them on my devices, I use extensions in my appIDs for each state :
- com.compagny.app for production
- com.compagny.app.integration for integration
- com.compagny.app.dev for develpment
And it seems that for IAPs YOU HAVE TO keep the exact same appID as it is on iTunesConnect... :/ That was just that...
Ok here goes trying to explain this as clearly as possible:)
I have developed an app for a partner.
They wanted to submit the app under their company so I was given the certs and profiles. I packaged the app ...they submitted and all was fine.
Now I need to update the app with new content. So all this is done and the client has set up new in App purchase products for the app.
The Problem:
When I am testing all of the "product requests" are successful and it displays the description of the product etc.
However when I come to test purchasing with a iTunes test account it does not work. It says
"This account doesn't have permission to make in app purchases. You
can change account permissions in iTunes Connect."
However to try and work out the problem, as a test I quickly set up a "test" app in OUR iTunes account and a new bundle id etc and set up same IAP products. I then changed the app ID for the actual client app to point at this. And this works fine no problem what soever when testing via Xcode on device.
I am at a loss at what is wrong here as when I did the original app all worked as expected as in I was able to use a iTunes test account I had set up to test their app.
Any ideas what might be going on?
regards
ade
Apparently the test user account needs to be on the same apple developer account as your app!
I'm trying to understand how to work with In App Purchases. I've read many documents and seen a lot sample codes but I can't understand why product list is empty. According to documentation and forums I made this:
Setup contracts on iTunes connect.
Create AppID on provision portal with unique bundle ID
Create and install provision profile for this AppId and enable In App Purchases
Create application on iTunes connect.
Create purchases for this application.
Submit application.
Reject application.
In code, I've tried to receive product information by product ID and as result I can see empty list. However, I can see an array of invalid product IDs.
Could you help me to understand what is wrong?
Thanks.
According to Apple documentation:
Follow these steps to test your application in the sandbox.
- Log out from your iTunes account on the test iOS device.
- Before you can test your application, you must first log out of your regular iTunes account. iOS 3.0 includes a Store category in the Settings application. 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.
I've tried it and can't see "Store Kit prompts you to authenticate" when I ask for products. Maybe I need to setup project in xCode?
Hm...
I can see products in Simulator of iOS 5 but can't buy it. Magic.
Try to delete your build and app on your device. I think this one should work.
It can take a good few hours for Apple's server to get round to enabling the in-app buys. I had the same problem that you did, but then it just started working half a day later.
I am having problems testing my in-app purchases. I get back valid product identifiers, but upon purchase I receive the dreaded "Cannot connect to iTunes Store". Interesting thing is that restore purchases seems to work - iTunes login pops up.
I have:
- Checked that my in-app purchases are cleared for sale
- Checked, rechecked my source code to be in sync with Apple's documentation
- Added appropiate test users
- app id does not contain wildcard
- in-app purchases are linked to the app (app itself is in developer rejected state, purchases are in ready to submit)
- waited
- reinstalled app, cleaned solution, all the voodoo stuff
Make sure you have signed out of any production iTunes accounts on the device.
I was getting this error on my test phone which was logged in with my actual iTunes account. You cannot test apps using your production iTunes account, hence the error. I just wish Apple provided a better error so as to avoid this guesswork...
see In-App Purchase FAQ: Cannot connect to iTunes Store
Your app is running in the Simulator, which does not support In-App Purchase
For testing in app purchases always use real devices.
For newcomers, make sure your in-app purchasing product's status is Ready to Submit, with no "missing metadata". In my case, what was missing was the localization of the subscription's group.
I've been having this problem and I'm convinced its a bug. I've filed a bug report with Bug Id 10108270
The problem seems to be that the test user is getting 'locked' and may have something to do with attempting to purchase an in app purchase in an already released app with that account.
My workaround was to create a new test user but until Apple get back to me, I can't provide any better solutions. I'll update this answer when I get replies.
This problem remains persistent in 2016. Incredible. Here was my solution:
Add a build number. Target > General > Identities > Build.
This is an old thread that is related to problem I was facing today.
In my case, I was able to test in-app purchases on my device till yesterday but it stopped working today. It turned out that Apple had pushed an 'Amendment for Paid Applications' for me to review and agree to. Once I agreed to the amendment (without reading it, of course), everything started working again. Did not have to create a new test user or any other workaround.
There may be many reasons for in-app purchases to not work but make sure you are correctly set up on itunesconnect or you won't be able to test in-app purchases.
I'm hitting the same issue. For me it happens after this secuence:
Install app on a device logged into a UK account on iTunes
Launch the app and use a test user set in USA
Message is shown saying account is only valid in USA. Closes the app and auto launches iTunes
Open your app again and retry purchase. Receive products but no other callback or error.
I don't know whether this is an issue on the IAP platform but I would like to get an error/callback to handle it in some way in my code.
To carry on testing your IAPs try any of these:
Remove Provisioning Profile in Settings area, remove App and log out from Store in Settings. Then go to XCode and change the signing identities to "Do Not Sign" to then put them back (I know how it sounds :) but try) OR
Hard reset all Settings on your device (Settings -> General...). Obviously you will loose any settings on that device...
Kill iTunes app on the device (multitask menu) and log out from the Store on the Settings
If none of the above work, it might be an issue on IAP platform, see my comments below.
Make sure the system status is ready https://www.apple.com/support/systemstatus/
I have an Iphone, Restart it worked for me
Here the exhaustive checklist if you got this error "cannot connect to iTunes Store" :
Make sure you have a sandbox user created in App Store Connect
Simulator DOES NOT support In-app purchase : test on real-device
The sandbox may be unreachable. Check the Apple System Status
Check that your app does have a bundle version (CFBundleVersion)
Check that the product is available for sale. Did you create it in App Store Connect?
If previous iOS 12, signed out of any production iTunes accounts on the device. Otherwise, you can just sign in within the dev app with your sandbox account.
You may also be getting this error when reusing an old sandbox account you tested a previous IAP on another app with (My scenario). Apple really needs to update the way we test IAPs, I'm running out of emails :0
I was able to purchase in-app on iPhone but not on iPad(11.0.2). I tried with all mentioned solution but none helps. After trying all other possibilities, finally I was able to make it work.
When you create a test account in iTunes connect, don't verify the email id. If it is verified, iap returns "Cannot connect to iTunes" error. It looks strange but it is how worked for me. In iPhone, irrespective of email verification, I am able to purchase using test account.
This error also had occurred when to SKProductsRequest passed wrong NSSet:
Wrong:
let products = NSSet(objects: ["id1", "id2"])
Correct:
let products = NSSet(objects: "id1", "id2")
In my case, I just forgot to handle .failed in transactionState. In particular, SKPaymentQueueue.default().finishTransaction(transaction).
The same issue got for me, and I had checked on the issue including Apple form, I couldn't find a solution.
Today when I checking the device I found that the following
In Device Settings -> iTunes & App Store found another Apple Id logged In.
So I tried signOut that and checked again the InApp purchase, it worked perfectly. So please check the issue is linked to the same or not.
Thanks & Regards,
Unnikrishnan.P
In addition to all the other methods outlined here, if you are working with subscriptions it seems you need to make sure you've generated a shared secret:
"To test or offer auto-renewable subscriptions, you must have a master shared secret or use an app-specific shared secret for each app."
A master shared secret is generated from the 'Shared Secret' tab of the 'Users and Access' section of App Store Connect.
An app-specific shared secret is generated where you manage the in-app purchases of the app itself.
I fixed mine! If you are getting Error Domain=SKErrorDomain Code=2 "Cannot connect to iTunes Store" error, make sure you insert SKPaymentQueue.default().finishTransaction(transaction). It worked for me after I added SKPaymentQueue.default().finishTransaction(trans) in the following:
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for trans in transactions{
if trans.transactionState == .purchased {
print("Successful.")
SKPaymentQueue.default().finishTransaction(trans)
} else if trans.transactionState == .failed {
print("failed!")
print(trans.error)
SKPaymentQueue.default().finishTransaction(trans)
}
}
Found in Apple developer website, here
I had to go to Settings > iTunes & App Stores, then scroll to the bottom to the "Sandbox Account" field and Sign out from there. Now it is working!!!
We've been trying to test in-app purchases in a sandbox environment, but fail to receive any data back from an SKProductsRequest. The callback
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
does get called but the response returns an empty array. Im testing this only for ipad, but both 3.2 and 4+ all seem to not get a response when I try this request.
I have read throughly through all intunes connect documentation so to tie the app on the iTunes connect with its inapp purchase items, and also all apple documentation on the SKProductsRequest object and the In App Purchase Programming Guide for help. I have tried resetting the certificates and starting all from scratch and followed the 'build for distribution' helper in the ios provisioning portal.
I have also built the app in all debug, release and distribution versions onto the device. I have watched and followed the WWDC2010 session 310 'App Publishing with iTunes Connect', but this is old as the enable inapp payments check button is no longer visible when creating app-ids in the provisioning portal site.
I have also made sure that my code signing is correct and the program matches the right app-id to which the requested inapp purchases are signed-off with. (see attached, the bundleid matches the identifier in Xcode.
I have made sure that the ipad has signed out of any iTunes accounts when running the test app, and added test users on the iTunes Connect page to test with. Our iTunes Connect banking information is fully completed.
I have also checked many forums and this process seems to be a big grey area for many, I have exhausted all thought on this, I just cant seem to get a response back for any product id.
...can anyone help me?!! Thanks people!
I found myself in a similar situation. The problem was I was using the wrong "developer identity" to sign my (development) binary. Since I often work for other companies, I've always just used my "personal" developer certificate to sign debug builds. Since those are test builds, I don't care what the appid is nor what company it is associated with. However, I realized that it would be insecure for Apple to allow random developers to query details about purchases for appid's that are not associated with them.
Make an adhoc provision for the project, and make sure you are signing your test builds with a develeper certificate that is associated with that company. The sandbox interface into the appstore for iAP must be verifying this at runtime.
Your making a very common mistake I have made myself with in-app-purchases. You have taken all the right step but you are missing one step. You need to submit the in-app-purchase. You do this by clicking on the in-app-purchase in the section of iTunes Connect which you can find by going to Manage Applications -> your app -> manage in app purchases. In this detail view you click the "Submit In-App-Purchase" button in the upper right corner. This button may be grayed out. If it is you must upload a binary for your app. You can reject it right away if you want to. Once you have done that you can go back to the detail view and click the submit button.