Helps with #26 but not a complete solution, as the product IDs are not returned in the restore handler. Rather, you would switch on the payment state in the fallback handler.
InAppPurchase.default.addTransactionObserver(fallbackHandler: { result in
switch result {
case .success(let state):
switch state {
case .purchased(let transaction), .restored(let transaction):
// update the local cache (UserDefaults, keychain, etc.)
// ...
}
// ...
}
})
InAppPurchase.default.restore()
Helps with #26 but not a complete solution, as the product IDs are not returned in the
restore
handler. Rather, you would switch on the payment state in the fallback handler.