Question

How to use receiveUpdated when "Offer codes" is applied

  • 23 August 2022
  • 2 replies
  • 100 views

Badge +2

Hello! I’m trying to implement iOS Offer Codes in my app and I’m stuck.

The documentation says that 

Apple does not provide a callback to determine if the code redemption was successful. Since the Purchases SDK will automatically pick up on new transactions that enter the underlying transaction queue, you should implement the receivedUpdated delegate or listener to respond to changes in CustomerInfo. Once we sync the Offer Code transaction, we'll automatically refresh CustomerInfo.

 

The following things are not clear to me as I plan to implement the receivedUpdate listener,

  1. What changes would happen in CustomerInfo?
  2. Will I be able to see which offer code was applied inside this listener? Can you please share how?
  3. Is there any way the CustomerInfo can retrieve the discounted price which was set on AppStore for this offer?

TIA


2 replies

Badge +2

Hey everyone, I’m not sure but will the receivedUpdate listener is supposed to receive some kind of “in progress” purchase info, and then we have to finish that purchase? Can you please give an example how to do that?

Badge +2

Hey everyone, I’m able to use the presentCodeRedemptionSheet function and get users to enter the code on the app in production. But as soon as the payment is done inside the apple’s code redemption sheet, the sheet stays open without a loader or anything. This means nothing happens after the code is entered and the payment is done via the sheet. The amount is not deducted from the Bank, but we tried multiple active cards which were working for other purchases.

Reply