Add UI error message when IAP succeeds but receipt verification fails
This should not be visible to end-users on normal circumstances, but we should regardless show an error message if something goes wrong with the IAP receipt verification, to prompt them to contact support. Testing ------- PASS Device: iPhone simulator iOS: 17.2 Damus: This commit damus-api: d3801376fa204433661be6de8b7974f12b0ad25f Setup: - Local Testing server - Xcode StoreKit environment Steps: 1. Set MOCK_VERIFY to false on the server (that means receipt verification will fail on Xcode environment) 2. Try to make IAP purchase. Error should appear on UI 3. Set MOCK_VERIFY to true on the server and restart StoreKit environment (Receipt validation will always work) 5. Try to make IAP purchase. Onboarding flow should go as normal with no error messages. PASS Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
@@ -144,6 +144,12 @@ struct DamusPurpleView: View, DamusPurpleStoreKitManagerDelegate {
|
||||
// If account is no longer active or was purchased via IAP, then show IAP purchase/manage options
|
||||
if let account_uuid {
|
||||
DamusPurpleView.IAPProductStateView(products: products, purchased: purchased, account_uuid: account_uuid, subscribe: subscribe)
|
||||
if let iap_error {
|
||||
Text(String(format: NSLocalizedString("There has been an unexpected error with the in-app purchase. Please try again later or contact support@damus.io. Error: %@", comment: "In-app purchase error message for the user"), iap_error))
|
||||
.foregroundStyle(.red)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.horizontal)
|
||||
}
|
||||
}
|
||||
else {
|
||||
ProgressView()
|
||||
|
||||
Reference in New Issue
Block a user