Skip to content

Instantly share code, notes, and snippets.

@anglinb
Created September 30, 2021 16:29
Show Gist options
  • Save anglinb/542c421059c51eef1bd6a8f47fc2c920 to your computer and use it in GitHub Desktop.
Save anglinb/542c421059c51eef1bd6a8f47fc2c920 to your computer and use it in GitHub Desktop.
Example implementation of shouldTryToRestore
class PaywallHelper: PaywallDelegate {
func shouldTryToRestore() {
Purchases.shared.restoreTransactions { (purchaserInfo, error) in
if let purchaserInfo = purchaserInfo {
if let entitlement = purchaserInfo.entitlements["membership"] {
if entitlement.isActive {
Paywall.dismiss() {
}
return
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment