Created
April 25, 2019 02:27
-
-
Save rkotzy/cebef06d72148fa08759b5e5313098e1 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
@available(iOS 12.2, *) | |
func showPromoUpsell() { | |
Purchases.shared.entitlements { (entitlements, error) in | |
// 1: - Get the discount for the product we want to offer | |
// | |
guard let product = entitlements?["pro_cat"]?.offerings["monthly_cats"]?.activeProduct else { | |
print("Error finding monthly_cat product") | |
return | |
} | |
guard let productDiscount = product.discounts.first(where: { $0.identifier == "promo_cat" }) else { | |
print("Error finding promo_cat discount") | |
return | |
} | |
// ... continued |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment