iOS In App Purchase Invalid Product Identifier - ios

I developed an app with with an in app purchase, and was testing in sandbox mode with no problems. I submitted the app to the app store, which was just approved. The accompanying in app purchase was also approved.
However, the approved version can not access the in app purchase. Looking at the console, the in app purchase is returned in the invalidProductIdentifier list. However, it works fine on my simulator.
Not sure how to go about debugging this.

I can't really post any comment, so I've been posting my comments as answers. I can only comment on my own answer. Anyway, this comment might be absurd or might be nonsense, but: I've read several articles before that sometimes IAP is not working on simulators.
I got two apps already on App Store that uses IAP, but never experienced that before. Try debugging using a real device.
Lastly, make sure that the Agreements, Tax, and Banking are all approved.

While the other recommendations for Agreements/Taxing/Banking are good, I already had completed them.
In my case, it was simply a matter of the approved app binary propagating through the app store servers faster than my approved In-App-Purchase. After around 30 minutes, it began to work once the IAP was available on all of the servers.

Related

In App Purchase subscriptions work for me in testing / Test Flight, but not for App Review team

I am dealing with a very frustrating App rejection. Apple has twice rejected my App with Guideline 2.1 - Performance - App Completeness. They're stating that the In App Purchase (an auto-renew subscription) is not unlocking the premium content after the purchase is made.
I have thoroughly tested this IAP on my end, on 3 devices, and 3 different TestFlight accounts. All tests worked flawlessly. I am unable to replicate the issue the Apple App review team is having.
The same IAP helper / receipt validation is also being used in another App of mine that has been working perfect for well over a year on the App Store.
I have ensured all product identifiers match up.
I have re-generated a Subscription Secret.
Is there anything I may be overlooking? What may cause the IAP to not unlock the content for JUST the App reviewer, and not any of my 6 unique devices that were tested and work perfect.
This has been resolved! My App was using expires_date in the receipt validation for the in-app subscription. It turns out, expires_date is bug-prone in certain configurations of devices (device / ios / locale). Because of this, the purchase was successfully finishing, but the premium content was remaining locked due to a misconfigured expiry date.
The solution was to use expires_date_ms instead of expires_date. It doesn't even look like expires_date is documented anymore on Apple's docs.
See: https://developer.apple.com/documentation/appstorereceipts/expires_date_ms
Hope this helps anybody running into issues of in-app purchase subscriptions not unlocking content!

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.

Cannot get my app approved because of error "Can not connect to iTunes"

I read many answers here with similar problems but none helped me to get my app approved. It's been 3 weeks of trial and error. I am totally frustrated of it.
What I am trying to do:
I am submitting my first app (there is no other app with my account created yet).
I have one in-app purchase (nonconsumable) in my app that removes ads and opens all content.
Sounds easy right?
I have been rejected for a few different reasons that has one thing in common - they (Apple testers) cannot successfully perform in-app purchase.
What I did:
Successfully bought and restored in app-purchase with my sandbox user.
At first I was using swifty storekit library. Got refused with "Unknown error. Please contact support" So I ditched this library and Implemented whole code myself, according to apple documentation.
As I read there can be problem with my agreements, tax and banking settings in Itunes connect - found out that there was red line about transfering my account settings (dont remember exact line) - did dissapear after 2 days by itself as I read in some answer here. There is no problem there now.
Did find out that I must wait some time before in-app purchase starts working. I takes about 2 days to in-app purchases start working with testflight user, so waited until it starts to work - then successfully bought in-app purchase and restore also works fine even with testflight testing account. (again got refused)
there is not exactly stated how to submit first in-app purchase ever, it is just said submit with binary. I did not get this at first, found out that I should not send in app purchase by itself, but I should "append" my in app purchase in the same form as I am sending my app. At first I tried to send my in app purchase in its own formular. But then I got rejected with error "We found that while you have submitted in-app purchase products for your app, the in-app purchase functionality is not present in your binary." (I say it again - there must be api there as I can successfully buy app with test account).
read in some other answer that I can ask to get my in app purchase approved, so I write "please approve my in app purchase - they did, but I got refused.
Now I cannot select this in app purchase with my binary, as it is not shown for selection probably because it is already approved. So I did submit app without it and got the "in-app purchase functionality is not present in your binary" error again.
Created new in app purchase, this one can be selected to be submited with app. Got rejected again, with error.
"can not connect to iTunes"
In app-purchase is then switched to "Developer Action Needed". This is probably a good thing as if they would approve it then I could not select it with binary as it would be invisible.
What else should I try? What to change? Where to look? I am totaly lost. 3 weeks of time lost. As I cannot reproduce the problem I cannot solve it. Programing is easy, but to get app approved looks like imposible.
Few of many many visited links:
In App Purchase functionality is not present in your binary
iOS In-App purchase works in development but not in production
https://forums.developer.apple.com/thread/13324
https://www.innofied.com/in-app-purchase-working-ios-solution/
What I did next: recorded video of myself successfully buying in app purchase with my testflight account and uploaded it to youtube, added link to my reply form.
Next try: I sent them this message:
"Good evening,
I am totally out of options. Is there anybody at apple who I can consult this? ... Because, everything is working on my side. As I cannot reproduce your problems I can't make it right.
I have tested it with my sandbox user - it works - I can make a purchase successfully and I can restore it too. I noticed that with testflight it needs some time to start working (about two days). So with this build I waited two days and when it did start working on testflight i submited my app. This is my first submit of app ever, should I do something special? You already approved my first in-app purchase in one of my trials, but I cannot select it to be published with my app as it is already approved (it is not shown, so cannot be selected) and if i dont submit it with my app then I got rejected with confusing error stating that in app purchase api is not included. So I created second in-app purchase - the one submited here which is now after rejection in "Developer Action Needed" as you rejected the app. So what can I do now? Don't you need to wait some time after you approve my in app purchase (submited with the app) to start working? Did you approve my in-app purchase which I submited with my app by the way? Please dont send me link to the documentation. As everything works on my side there is nothing I can find there. Give me some advice or contact to someone who can Investigate what is wrong on your side, as you cannot make it work... thank you in advance"
After rougly one day, status did change (they changed) to "in review", and after another half hour I did get email with "Congratulations! We're pleased to let you know that your app, Juggling, has been approved for the App Store"
So to answer my own question ... how to get through application approval? I don't know. What I did wrong, what should I do? I don't know. Are there real people there or artificial inteligence? I don't know. What exactly was the problem? I don't know. What did finally do a change? I don't know. Hope this answers will help next generations of programmers get their apps approved in the future. (Pun intended)
Thank you

In app purchase not working after publishing iOS app to App Store

During development I've created test accounts which are able to obtain the price of the in app purchase as well as actually purchasing it without an issue. However after publishing the iOS app to App Store, the version of the app in App store can't even retrieve price of the product, and nothing shows up when I press the button to send the purchase request.
Uninstalling the app and redeploy the development version to the same device got it to work again.
What could be the problem? Is there a way to debug or see logs on the app store downloaded version? (iOS noob here)
Thanks!
I had the same problem. The app was approved but in-app purchases were not working. After 24-48 of app publishing problem was fixed by its own. By the time app approved it was not appearing on App Store through search. After it was indexed on App Store in-apps started to work also.
It takes a little time even when everything is approved.
My binary was approved.
My In-App Purchase (IAP) was approved.
Testing the purchase in development with a sandbox iTunes Account worked great.
Purchasing in production with a real or sandbox iTunes Account would fail.
I didn't have to wait long, something like a couple hours and it just started working.
Now, my binary and my In-App Purhcase were approved at the same time and almost immediately after they were both approved, I released the app version to the store.
I'm not positive, but what I probably should have done was wait a couple hours before releasing that new app version and give the In-App Purchase a chance to "register" or "propagate" in the Production App Store.
Just a recommendation for others.
It takes some time, but the amount isn't predictable. In my case, I launched 3 very similar apps at the same time, so just add some data on this :
Everything was approved, the apps were quickly available on the App Store.
It took about 4 hours for 2 of the apps to show up in search results.
After 6 hours, IAPs started progressively showing up (not all at once) for these
After 9 hours, IAPs for the two apps were complete.
After 12 hours, IAPs for the last app started appearing, but the last app itself still wasn't showing up in search results.
After 14 hours, the last app appeared in search results.
The order in which I hit the "Publish" button didn't seem to have any influence, nor the number of IAPs, weight of the app, etc.
So delays are unpredictable and do not follow a specific rule ("First-in, first-out" or "search results and then IAP")
I found this Apple Tech note, which is includes follow:
Q. App Review has recently approved my application, but my In-App Purchase identifiers in the production version of the application are being returned in the invalidProductIdentifiers array.
A. When an application is approved, the developer must also approve the application for release to the App Store. On approval, the application ID is activated to the App Store. The same activation is required for the in-app purchase identifiers and can only take place once the application is activated. In some cases, the activation of the In-App Purchase identifiers may lag up to 48 hours following the activation of the application.
If the developer does not approve the release of the production application to the App Store, then any new in-app purchase identifiers will not be activated. This is an issue when a developer wants to verify the application prior to activating it on the App Store. If the desire is to test the in-app purchase process for the new items, the application must be activated to the App Store. This is only an issue for new in-app purchase identifiers in a corresponding application submission. Once these in-app purchase identifiers have been activated, application updates to the submission will find that these in-app purchase identifiers are validated, even if the update is not activated.
But in my case it takes even further, about 52 hours.
I found that doing a simple edit of the description in each IAP helps. Just make an edit, save it, revert to the original and save again. It took up to 8 hours for it to propagate across Apple servers. IAP's I didn't do this to had no change.

iOS: In-App-Purchase fails for some users in production

I've recently released an iPad app which has a non-consumable "pro upgrade"-style In-App-Purchase.
It works for most users, and it worked when testing. However, I do get daily reports of the IAP crapping out for some customers of the app.
It is the worst kind of bug:
For most people, it seems to work fine.
For some people, it works after a reboot of the device or logging out from the App Store.
For
some other people, nothing seems to help and they can't make the
purchase.
And I do not have any remote logging implemented...
This seems to happen across various locales / different iPad models / OS versions.
For those which can't make the purchase, usually an error pops up which says that their Apple ID password is incorrect, after confirming the purchase.
The purchase button in the app only appears after the IAP product was received from Apple's server successfully.
I am not sure how to track down what's going on there. I was initially thinking it's on Apple's side, but the number of people reporting it tells me it must be something with my app.
Any best practices on how to debug this?
thanks!

Resources