Swiftui / Xcode 15.4 / iOS 17.5.1
When using the .presentPaywallIfNeeded modifier, I and not seeing any of the restore completion handlers called when that function is tapped. This includes restoreStarted, restoreCompleted or restoreFailed. The other completion handlers to include those around purchases and the onDismiss do fire correctly.
In my case, I don’t have a subscription to restore. When restore is invoked “DEBUG: Restored purchases successfully with no subscriptions” is returned to the console. However, there is no alert shown to the user. Whether it should be from RevCat or not is another question. However, looking to use the completion handlers to provide our own alert is not possible due to the completion handlers not functioning around restore.
The modifier is below.,
.presentPaywallIfNeeded(
requiredEntitlementIdentifier: K.entitlementID,
offering: nil,
fonts: DefaultPaywallFontProvider(),
presentationMode: .sheet,
purchaseStarted: { package in
print("Purchase started")
},
purchaseCompleted: { info in
print("Purchase completed")
},
purchaseCancelled: {
print("Purchase cancelled")
},
restoreStarted: {
print("Restore started")
},
restoreCompleted: { info in
print("Restore completed")
},
purchaseFailure: { error in
print("Purchase failure")
},
restoreFailure: { error in
print("Restore failure")
},
onDismiss: {
shouldShowPaywall = false
})