I’m trying to retrieve my in-app purchase products using SwiftyStoreKit in Swift.
let ids: Set = [monthly_InApp, yearly_InApp, lifetime_InApp]
SwiftyStoreKit.retrieveProductsInfo(ids) { result in
if result.retrievedProducts.count > 1 {
for product in result.retrievedProducts {
if product.productIdentifier == monthly_InApp {
Popup.show(message: "\(product.productIdentifier)", title: "retrievedProducts")
self.monthly_Price_Str = product.localizedPrice ?? ""
self.monthly_Price = Double(truncating: product.price)
} else {
Popup.show(message: "\(product.productIdentifier)", title: "retrievedProducts")
self.yearly_Price_Str = product.localizedPrice ?? ""
self.yearly_Price = Double(truncating: product.price)
}
}
}
if result.error != nil {
// Popup.show(message: "\(result.error)", title: "error")
}
if result.invalidProductIDs.count > 0 {
// Popup.show(message: "\(result.invalidProductIDs)", title: "invalidProductIDs")
}
}
When I run this, I always get my product IDs in invalidProductIDs.
I also tried using SKProductsRequest directly, and I see the same thing:
Invalid IDs from SKProductsRequest: ["com.mkkriti.monthly", "com.mkkriti.yearly"]
What I’ve checked so far:
My product IDs in App Store Connect are exactly:
com.mkkriti.monthly
com.mkkriti.yearly
In App Store Connect the product status shows Ready to Submit.
Bundle identifier in Xcode matches the one in App Store Connect.
In-App Purchase capability is enabled in Xcode.
Testing on a real device (not simulator).
Question:
Why do my valid product IDs still show up as invalid when retrieving products?