I'm adding in-app purchase in my app using the new ProductView. The first time I tried to purchase my product, I got an alert saying "You're all set". But when I purchased my product a second time, the alert did not show up. The product is a consumable. Why is that alert not showing? What am I missing?
ProductView(id: productId)
.productViewStyle(.compact)
.onInAppPurchaseStart { product in
logger.log("User has started buying \(product.id)")
}
.onInAppPurchaseCompletion { product, result in
if case .success(.success(let transaction)) = result {
logger.log("Success")
} else {
logger.log("Failure")
}
}
After the purchase is successful you still need to call
finishon thetransactionsomewhere down the line.