Receiving Vouchers
Claiming
Use the VoucherOpenHelper
to open the claim flow provided you have the Voucher
or FeedVoucher
object.
VoucherOpenHelper.openClaim(Context context, Voucher voucher);
VoucherOpenHelper.openClaim(Context context, FeedVoucher voucher);
VoucherOpenHelper.openClaim(context: Context, voucher: Voucher)
VoucherOpenHelper.openClaim(context: Context, voucher: FeedVoucher)
Note: If the Voucher can not be claimed by the current user they will be shown a preview of the gift reveal
Claiming with an Invite Code
If you received an invite code to claim a Voucher, the Voucher can be claimed with the openInviteCode()
funtion found within the VoucherOpenHelper
class.
VoucherOpenHelper.openInviteCode(getContext(), code);
VoucherOpenHelper.openInviteCode(context, code)
where code
is your invite code in string form. If you received your code as a URL, the invite code is the portion following the #
and ending at the ;
if present.
Additional Setup
Though not needed, customization for the claim flow can be setup using the ClaimConfig.
ClaimConfig claimConfig = new ClaimConfig.Builder()
.setImageOptions(Arrays.asList(ClaimConfig.ImageOptions.GOOGLE, ClaimConfig.ImageOptions.GIPHY))
.enableImageSearch(false)
.confettiParticle(R.drawable.ic_check_circle)
.confettiSizeDP(10)
.build();
val claimConfig = ClaimConfig.Builder()
.setImageOptions(listOf(ClaimConfig.ImageOptions.GOOGLE, ClaimConfig.ImageOptions.GIPHY))
.enableImageSearch(false)
.confettiParticle(R.drawable.ic_check_circle)
.confettiSizeDP(10)
.build()
Then add it to your VouchrEngine
engineBuilder.addClaimConfig(claimConfig);
engineBuilder.addClaimConfig(claimConfig)