Voucher - xamoom/xamoom-ios-sdk GitHub Wiki

In this guide you will learn how to redeem and check the status of vouchers.

General

A content can be marked as a voucher, and can have n redeem codes. Every clientID can redeem a code once.

Status

Use the method voucherStatusWithContendID to check if voucher is redeemable by the clientID.

It takes two arguments:

  • contentID - content ID that is marked as a voucher
  • clientID - client app identifier

It returns NSURLSessionDataTask with two parameters:

  • isRedeemable - Boolean that says if voucher can be used by client
  • error - NSError, can be null

Redeem

Use the method redeemVoucherWithContendID to redeem a code. Remember, a clientID can only redeem a code once.

It takes three arguments:

  • contentID - content ID that is marked as a voucher
  • clientID - client app identifier
  • redeemCode - voucher redemption code

It returns NSURLSessionDataTask with two parameters:

  • isRedeemable - Boolean that says if voucher can be used next time by this client
  • error - NSError, can be null