Once everything is set up in App Store Connect and WinWinKit, you need to add support for Offer Codes in your app.

Support Offer Codes

When a user is rewarded with an Offer Code, there is two ways they can redeem it:

  • through a redemption URL, which opens the App Store
  • directly in your app.

WinWinKit supports both ways, so you can choose which one to use. However, we recommend you implement support for both ways.

Redemption URL

Follow the Apple’s documentation to implement support for Offer Codes redeemed outside of your app:

Support offer codes redeemed outside of your app

If you use RevenueCat, you don’t need to implement this, as their SDK listens for updates on Transaction already.

Inside app

Follow the Apple’s documentation to implement support for Offer Codes redeemed in your app:

Redeem offer codes in your app

Essentially you only need to present a native sheet where user can enter the Offer Code value.

Retrieve and Redeem Offer Code

WinWinKit provides Offer Code value for active rewards for the user.

Available Offer Code reward and value can be retrived on the User object.

Retrieving Offer Code value with Swift SDK:

let offerCodeRewards = Referrals.shared.user?.rewards.active.offerCode
let offerCodeReward = offerCodeRewards?.first

// The value that can be presented to the user, and they can redeem in the app. 
let offerCodeValue = offerCodeReward?.value.value

// The redemption URL that can be used to redeem the Offer Code in the App Store.
// You can open this URL to prompt the user to redeem it.
let offerCodeRedemptionURL = offerCodeReward?.value.link

// The expiration date of the Offer Code value. 
// After the expiration date, a new value will be assigned, unless the reward is expired before.
let offerCodeExpirationDate = offerCodeReward?.value.expiresAt

For new users, redeeming an Offer Code is starting a subscription in your app.

For existing users, redeeming an Offer Code is starting, adding, changing, renewing or getting temporary discount on a subscription in their account. What happens depends on the subscription type and the Offer Code they redeem.


For more information please refer to the App Store Connect documentation:

Supporting offer codes | Design Guidelines

Supporting subscription offer codes in your app

Implementing offer codes in your app