Skip to content

Coupon module

The module that redeems, on the Hive Axyl server, coupon codes that app users enter. When a coupon is redeemed, the coupon's items are granted to the logged-in user's mailbox.

Module information

  • Package: com.com2usplatform.hiveaxyl.coupon
  • Namespace: Hive.Axyl.Coupon
  • Supported platforms: All (server API)
  • Minimum requirements: Unity 6000.0+

Provided interfaces

Interface Registration method Description
ICouponService AddCoupon() Coupon code redemption

The coupon's items are granted by mail, so for retrieving the granted mail and marking it as read, see Mailbox module.

Registration and retrieval

Register it with AddCoupon() in the registration step of HiveBootstrap.Initialize, and then retrieve it with HiveCore.Resolve<T>().

using Hive.Axyl.Core;
using Hive.Axyl.Core.Unity;   // HiveBootstrap
using Hive.Axyl.Coupon;

var config = CoreConfig.CreateBuilder("{appId}").Build();

HiveBootstrap.Initialize(config, builder =>
{
    builder.AddCoupon();
});

ICouponService coupon = HiveCore.Resolve<ICouponService>();

The methods of ICouponService require a login session.