Created
April 25, 2019 02:26
-
-
Save rkotzy/d3a851f092b2352d9277da8270007ada to your computer and use it in GitHub Desktop.
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
func shouldShowSubscriptionOffer(_ purchaserInfo: PurchaserInfo) -> Bool { | |
// Check that the user has a 'pro_cat' entitlement that expired >= 7 days ago | |
// and check that we haven't previously shown this offer to the user | |
if (purchaserInfo.expirationDate(forEntitlement: "pro_cat") ?? Date()).addingTimeInterval(7*86400) <= Date() && | |
!UserDefaults.standard.bool(forKey: "has_seen_promo_cat_discount") | |
{ | |
return true | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@rkotzy
the result never changes,
so it does not make sense.