Created
September 30, 2021 16:29
-
-
Save anglinb/542c421059c51eef1bd6a8f47fc2c920 to your computer and use it in GitHub Desktop.
Example implementation of shouldTryToRestore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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