Skip to main content
Question

Handling Purchase After Reddem Coupon Code iOS


Forum|alt.badge.img+5

Hi there,

I am using Offer Codes on iOS App Store.

So I am using Purchases.shared.presentCodeRedemptionSheet() to trigger redeem coupon view. 

How can I handle the purchase and execute some code after purchase is done?

 

Normally I can handle it inside 

Purchases.shared.purchasePackage(package) { _, purchaserInfo, _, _ in

But I want to know how to handle that case when using presentCodeRedemptionSheet

2 replies

sundeep
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 138 replies
  • January 22, 2022

Hi @Utku Dalmaz,

`presentCodeRedemptionSheet()` doesn’t have a callback so you’d have to rely on our PurchaserInfo listener to detect when purchases are made through that flow. You can read about it more here:
https://docs.revenuecat.com/docs/purchaserinfo#listening-for-purchaser-info-updates
https://www.revenuecat.com/blog/how-do-apple-offer-codes-work


Forum|alt.badge.img+5
  • Author
  • New Member
  • 3 replies
  • January 22, 2022

Thanks. When I want to use this with PurchaserInfo

extension AppDelegate: PurchasesDelegate {
    func purchases(_ purchases: Purchases, didReceiveUpdated purchaserInfo: Purchases.PurchaserInfo) {
        // handle any changes to purchaserInfo
    }
}

How can I differentiate the payments whether a normal subscription or offer code?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings