0

I am creating offer codes with auto-renewable In-app purchases in swift. But when i use presentCodeRedemptionSheet(), it does not show any redemption page to redeem offer code. I am using below code, but nothing is happening on tapping the button.

let paymentQueue = SKPaymentQueue.default()
if #available(iOS 14.0, *) {
    DispatchQueue.main.async {
        paymentQueue.presentCodeRedemptionSheet()
    }
}
Witek Bobrowski
  • 3,749
  • 1
  • 20
  • 34
Man_Parashar
  • 93
  • 1
  • 10

1 Answers1

3

Are you trying on the simulator?

This command only works on a real device not in the simulator.

jfgrang
  • 1,148
  • 13
  • 13
  • no, on a real device. Actually, I was trying to test it with the Sandbox acc but it was not working, i have checked the docs and found that it will only works with production apple acc. – Man_Parashar Jul 07 '21 at 05:36
  • But how can we be sure that this only works in production? Is there any way to test it before we make it live? – Vin Nov 16 '22 at 14:40
  • You can see the view presented even with Sandbox, but than when you input code it returns "incorrect code" if you are on sandbox version – Salome Tsiramua Jun 30 '23 at 13:23