Hey everyone,
I'm facing a bit of a puzzling issue with the review of my app, particularly with the in-app purchase functionality for message extension/sticker packs. I've implemented the entire store using StoreKit for in-app purchases, using exactly the same code like it is in Apple's demo application (https://developer.apple.com/documentation/storekit/in-app_purchase/implementing_a_store_in_your_app_using_the_storekit_api).
Here's the problem: the products appear correctly according to what's set up in App Store Connect (In-App Purchases section), and the purchase process works flawlessly in sandbox and TestFlight environments. However, during the review process, I received the following feedback:
"Guideline 2.1 - Performance - App Completeness We found that your in-app purchase products exhibited one or more bugs which create a poor user experience. Specifically, the app kept loading indefinitely when we tapped on “Shop”. Please review the details and resources below and complete the next steps."
It seems that the products are not loading properly in the environment used by the reviewers. What's most puzzling is that another app with the exact same store implementation has passed the review and is available in the store (https://apps.apple.com/pl/app/the-prince-frog/id6478831171?l=pl).
I'm running out of ideas on what could be causing this discrepancy, especially since everything is functioning correctly in sandbox and TestFlight. Could someone please take a look at the code in Store.swift in this demo project and point out what might be missing?
Any help or insights would be greatly appreciated! Thanks in advance.
@MainActor
func requestProducts() async {
do {
//Request products from the App Store using the identifiers that the Products.plist file defines.
let storeProducts = try await Product.products(for: productIdToEmoji.keys)
for product in productIdToEmoji.keys {
toDebug = toDebug + ", " + product
}
var newCars: [Product] = []
var newSubscriptions: [Product] = []
var newNonRenewables: [Product] = []
var newFuel: [Product] = []
//Filter the products into categories based on their type.
for product in storeProducts {
switch product.type {
case .consumable:
newCars.append(product)
case .nonConsumable:
newCars.append(product)
case .autoRenewable:
newSubscriptions.append(product)
case .nonRenewable:
newNonRenewables.append(product)
default:
//Ignore this product.
print("Unknown product")
}
}
//Sort each product category by price, lowest to highest, to update the store.
cars = sortByPrice(newCars)
subscriptions = sortByPrice(newSubscriptions)
nonRenewables = sortByPrice(newNonRenewables)
fuel = sortByPrice(newFuel)
} catch {
print("Failed product request from the App Store server: \(error)")
errorMessage = error.localizedDescription
}
}