Coupon Service
Coupon Service is a reward program for users that input coupons published by the IGAW Coupon Service.
For more information on Coupon Service, please go to the following link.
Notice
- IGAW must be integrated before integrating the coupon add-on. [IGAW Common Integration : Unity Android]
- In order to integrate the coupon service, IgawCoupon~*.jar file must be included in Unity project. [SDK Installation : Unity]
Coupon API
To use coupon service, the integration should be proceeded through the following APIs.
Input User ID
User ID is a set of information to identify users who have completed the campaign and are eligible for a reward.
User ID must be set before the user inputs the coupon codes.
Notice
- One user should only have one unique value, not variable.
- Must not contain any personal information(email, name, phone number, username).
- Must go through URL encoding if contains Korean, special character, or blank space.
- It should be set before the user enters the coupon codes.
Follow the above notice when input the User ID value.
IgaworksUnityPluginAOS.Common.setUserId("user10001");
Coupon Display
A UI for users to input a coupon code is needed. Refer below to setup a coupon code input modal dialog.
- Use Coupon SDK
- Use your custom UI
You can use a UI provided by Coupon SDK or a customized UI. Integrate using the following steps for the appropriate UI.
Use Coupon SDK
Call up showCouponDialog API to display an input window. See below for a parameter example.
- showResultToast : Whether to show the message of the result of using the coupon as a Toast; true or false
IgaworksUnityPluginAOS.Coupon.showCouponDialog(true);
Use Your Custom UI
checkCoupon API should be called up to transmit the coupon code entered by a user parameter. The result will be returned accordingly.
Transmit the coupon code entered by a user in the "coupon code" in the example below as string.
IgaworksUnityPluginAOS.Coupon.checkCoupon ("Coupon code");
Coupon Delegation
In the Coupon Service, delegation to receive the result of the coupon is available.
- OnSendCouponSucceed : Delegation of the succeed coupon use
- OnSendCouponFailed : Delegation of failed coupon use
To use coupon delegation, it should be registered as listed below.
public class MySampleScene : MonoBehavior {
void Start () {
// Register succeed coupon use delegate
IgaworksUnityPluginAOS.OnSendCouponSucceed = mOnSendCouponSucceed;
// Register failed coupon use delegate
IgaworksUnityPluginAOS.OnSendCouponFailed = mOnSendCouponFailed;
}
void mOnSendCouponSucceed (string msg, int itemKey, string itemName, long quantity) {
//msg : The result of the coupon use
//itemKey : Key of virtual currency that will be given from the used coupon, Deprecated
//itemName : Virtual currency that will be given from the used coupon
//quantity : Value of the used coupon
}
void mOnSendCouponFailed (string msg) {
//msg : The result of the coupon use
}
}
IGAW Reward Server Integration
Note that IGAW reward server integration must be established to provide rewards to users who entered a coupon code.
In our Coupon Service, the reward server integration method is supported through our internal server.
Check the following link for more information on IGAW Reward Server integration.
[IGAW Reward Server Integration Guide]