I implemented consumable in-app purchases in an iPhone app using ProductView().
When I tap the payment button in ProductView(), I am taken to the payment screen and once the payment is completed the next code seems to be executed, so there doesn't seem to be a problem, but if I tap the payment button in ProductView() again, the next code is executed without taking me to the payment screen.
This means that a single payment can be made multiple times.
Can someone help?
ProductView(id: "geminiOneMatch")
.productViewStyle(.compact)
.padding()
.onInAppPurchaseCompletion { product, result in
if case .success(.success(_)) = result {
// 課金が成功した場合の処理
gemini.addOneMatch(amount: 20)
popUpVM.geminiOneMatchPopUp = false
dataManageVM.generateRespons(locale: locale)
}
}