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