Skip to main content

iOS - yuu Redeemed Coupon page

Redeemed Reward Selection (Web View)

After a successful login, the SDK provides a web view where users can view their redeemed rewards. Once a user selects rewards, the SDK will return a list of reward IDs back to your app.

Parameters

from (UIViewController, required): The view controller that the login web view launched.

selectedRewardIds ([Int], required): An array contains the rewardIds of selected voucher.

callBackUrl (String, required): The URL scheme of your app, this is where the SDK will redirect once the reward selection is completed.

rewardType (RewardType, required): The RewardType enum is used to filter which rewards are shown on the redeemed reward list page. Default value is all.

RewardType Enum

The RewardType enum is used to filter which rewards are shown on the redeemed reward list page.

Enum Valuetype ValueDescription
all"ALL"Shows all available rewards
cashVoucher"Cash"Shows only cash voucher
rewardOffer"REWARD_OFFER"Shows only reward offers

netBasketAmount (Int, optional): The total net amount in the basket / checkout list. Default is 0.

basketItems ([BasketItem], optional): An array of BasketItem objects representing the items currently in the user's basket. This information is passed to the SDK to provide a better user experience.

promoId (String, required): The promotion ID of the item.

quantity (Int, required): The quantity of the item.

class BasketItem: NSObject, Codable {
var promoId: String
var quantity: Int
}

Response

rewardList ([MembersReward]): The issued reward list getting from yuu Backend.

class MembersReward: NSObject, Codable {
var rewardId: Int
var rewardTypeExternalReference: String
var rewardTypeRetailValue: Int
var voucherCode: String
var rewardType: String
var rewardBarcode: String
var standardBarcode: String
var rewardExpiryDate: String
}

Field Descriptions

  • rewardTypeExternalReference: The unique identifier for the general reward campaign or promotion.
  • rewardId: The unique identifier for the user's specific redeemed instance of the reward.
  • rewardBarcode: The barcode data used to generate a QR code or barcode in the UI, enabling Point of Sale (POS) systems to scan and apply the reward.
  • standardBarcode: The product barcode associated with the reward. This maps directly to the id property in the BasketProduct model, allowing the SDK to match available vouchers against specific items in the user's basket.
//Cash Voucher Case
YuuManager.shared.getRedeemedRewardList(from: self,
selectedRewardIds: selectedRewardIds,
callBackUrl: "<YOUR APP DEEPLINK>",
rewardType: RewardType.cashVoucher,
netBasketAmount: 10){ voucherList, error in
//Add your code here
}
//Reward Offer Case:
let basketItems = [BasketItem(promoId: "PROMO123", quantity: 1)]
YuuManager.shared.getRedeemedRewardList(from: self,
selectedRewardIds: selectedRewardIds,
callBackUrl: "<YOUR APP DEEPLINK>",
rewardType: RewardType.rewardOffer,
basketItems: basketItems){ voucherList, error in
//Add your code here
}

Fetch Redeemed Reward List (Background API)

Retrieves the user's issued rewards in the background. This is useful for comparing rewards with the user's cart items to auto-apply vouchers.

YuuManager.shared.getIssuedRewardList(rewardType: .all) { rewardList, error in
//Add your code here
}