I'm adding purchases to the iOS app.
My app's bundleID looks like this "company.My-App-Name-with-Dashes".
When creating Product in appstoreconnect, ProductID should have been like "company.My-App-Name-with-Dashes.myProduct"
But validation not allows symbol dash "-" in that field.
So i have created ProductID just like "myProduct" and one more like "company.My_App_Name_with_Dashes.myProduct"
Both products are ready for review in status.
I have sandbox tester account logged in on my test device.
Swift code with SwiftyStoreKit:
SwiftyStoreKit.retrieveProductsInfo(["myProduct", "company.My_App_Name_with_Dashes.myProduct"]) { result in
if let product = result.retrievedProducts.first {
// Never gets here
let priceString = product.localizedPrice!
print("Product: \(product.localizedDescription), price: \(priceString)")
}
else if let invalidProductId = result.invalidProductIDs.first {
// Always here
print("Invalid product identifier: \(invalidProductId)")
}
else {
// Never gets here
print("Error:", result.error ?? "")
}
}
- Invalid product identifier