Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 587
madmik3 Avatar asked Nov 12 '14 22:11

madmik3


2 Answers

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. :/

like image 143
thephatp Avatar answered Nov 08 '22 14:11

thephatp


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.)

like image 4
Derek Lee Avatar answered Nov 08 '22 15:11

Derek Lee