Skip to main content
Question

Handling Purchase After Reddem Coupon Code iOS

  • January 11, 2022
  • 2 replies
  • 187 views

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

This post has been closed for comments

2 replies

sundeep
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 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
  • 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?