In App Purchase Products that are not "Cleared For Sale" showing up in Sandbox mode
Asked Answered
D

2

11

I have some in app purchases that are not cleared for sale in iTunes Connect.

My goal is to be able to enable and disable them after the app is launched when needed.

However when I test in sandbox mode all of these products show up. I had assumed that SKProductsResponse would return any invalid products in it's invalidProductIdentifiers method.

Is this a difference between the SandBox and production modes? Will these products always show up even if they are not cleared for sale?

Dyaus answered 12/11, 2014 at 22:45 Comment(2)
Having the same problem here: my products are not cleared for sale, yet they are returned as valid products by Apple's server, at lease while running the app in debug mode. Since it is impossible to debug a published app, I can't tell for sure whether the published app gets the exact same answer, but its behavior strongly suggest it does. And when trying to purchase such products with the published app, the mention 'Environment: Sandbox' is shown in the purchase dialog.Nonscheduled
I've found no valid way to remove them. They do not show up on published builds.Dyaus
L
14

Yes, there is a difference. I just released a version of my app which checks for 11 different IAPs, only 4 of which are Approved. Of those, only 1 is "Cleared for Sale." Thus, in product, only 1 shows up. For the others that are in the state "Approved," when I change them to be "Cleared for Sale" they show up in my app in production (once the change has propagated from Apple's servers, which takes several hours).

However, in the Sandbox, ALL product identifiers that my app is looking for displays, because it finds them in the AppStore. They are blank, just as you said. SKProduct does NOT have a property available to check for this "Cleared for Sale" flag.

In fact, I found your post, because I was hoping to find others in this situation--because my new version just got rejected because of these "blank items." You'd think the app store reviewers would know that the Sandbox behaves differently than Production. :/

Ledezma answered 21/10, 2016 at 0:32 Comment(0)
C
6

Some additional differences between the Sandbox and Production environments worth noting:

#1. "Developer Removed From Sale" IAPs Acknowledged As Valid Products

I've had an app in the Apple App Store for some time and recently have decided to remove one In-App Purchase (IAP) from sale. After doing this, in the IAP settings for this app on iTunesConnect (AppStoreConnect), the status of this product is shown as "Developer Removed From Sale":

Developer Removed From Sale

Even still, the SKProductsRequestDelegate.productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) method returns this "Developer Removed From Sale" IAP product as valid product in the response.products list when using the Sandbox environment, even though the Production environment returns this IAP Product ID in the response.invalidProductIdentifiers list.

What's more confusing is that the Sandbox environment still allows me to purchase this product from within my app even though it is marked as "Developer Removed From Sale". 🤔

I contacted Apple Developer Technical Support (DTS) about this and I was asked to open a bug report with Apple to communicate this behavior to them as it seems as if this is not the desired functionality.

#2. "Developer Removed From Sale" IAPs Receipt Validation + SKProductsRequest

Since the above IAP had been removed from sale I thought I should also remove the IAP Product ID from the SKProductsRequest initWithProductIdentifiers() call.

Unfortunately, when one of my users attempted to restore their purchases, because the IAP Product ID was not included in the SKProductsRequest init, I was not able to validate the purchase in the receipt (it appears as though the receipt data received from Apple did not include products of this type).

Therefore, even if you remove an IAP from sale, you still need to include that IAP Product ID in the SKProductsRequest in order for users to be able to restore previously purchased IAPs.

(I felt that my experience was related to this question and that replying here, as opposed to opening another question, would be more effective for people searching for this information.)

Communalize answered 1/5, 2019 at 3:55 Comment(1)
Thanx for sharing, all the experiences are worth gold in this subject. It's just too confusing. In their defence, you could test out products that are not released yet this way, but you cannot test removing them from sale!Ludmilla

© 2022 - 2024 — McMap. All rights reserved.