Code Redemption Testing

Hi!

We have implemented the redemption of offer codes using the function

SKPaymentQueue.default().presentCodeRedemptionSheet()

The redemption view appears correctly and the flow ends successfully, we receive the callback from apple on the server side, the problem is that we do not receive feedback on the app side and we cannot guarantee a good user experience. in particular it seems that the function

paymentQueue (_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])

is not called, but we are not sure.

The standard app purchase flow works fine, but code redemption does not.

In general it is very difficult to test these discount codes because they are only testable with the app in production, without being able to take advantage of the debug prints or breakpoints. In addition, a particular offer can only be redeemed once per apple id

Is there any way to test offer codes in debug mode?

How could we do some tests on the code without having to send the app for verification every time?

Thank you!

Post not yet marked as solved Up vote post of btdev Down vote post of btdev
2.2k views
  • Hello @btdev, did you find any ways to resolve your issue?

Add a Comment

Replies

same problem!

You cannot test subscription offer codes in the Sandbox. 

When a customer successfully redeems an offer code from a live app in iOS 14 and later, the app receives a purchased transaction and its receipts contains the offer_code_ref_name field after validation. As such, redeeming an offer code creates a transaction in an app’s receipt in the same manner that a regular transaction occurs. However, this field is unsupported in receipts for apps tested in the Sandbox. However, you can simulate redemption that occurs outside of your app in the Sandbox by resubscribing using an Apple ID that subscribed in the past in the Manage Subscriptions page on an iOS 14 or later device.