로딩중입니다
Coupon Integration : Android
5/27/2015 11:20:01 AM

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.

[Coupon Service Guide]

 


Notice
  1. IGAW must be integrated before integrating the coupon add-on. [IGAW Common Integration: Android]
  2. In order to integrate the coupon service, IgawCoupon~*.jar file must be included in Unity project. [SDK Installation: Android]



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. 


Notices
    1. Personal information should not included. (e.g., e-mail, name, telephone number, identifiable user ID, etc.)
    2. If a Korean character, spacing, or special character is used, it must be URL encoded.
    3. It should be set before the openOfferwall API is called up.

User identification values should be entered while keeping the notices above in mind.

IgawCommon.setUserId("user10001");


Coupon Display

A UI for users to input a coupon code is needed. Refer below to setup a coupon code input window.

  1. Use Coupon SDK.
  2. Use Your 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

showCouponDialog API should be called up to display the entry window. See below for a description and examples on using the respective parameters.

  • showResultToast : Choose whether to display the coupon usage results in toast form (True or False).
  • ValidationResultModel  : showResultToast를 false로 설정하였을 때, ValidationResultModel 타입의 ValidationResultModel[i] 배열로 전달되며, 배열에 포함된 정보는 다음과 같습니다.   
    • ValidationResultModel.getResult() : Coupon usage result
    • ValidationResultModel.getMessage() : Coupon usage result message
    • ValidationResultModel.getItemKey() : Coupon item key
    • ValidationResultModel.getItemName() : Coupon item name
    • ValidationResultModel.getQuantity() : Amount of virtual currency for reward
 IgawCoupon.showCouponDialog(MainActivity.this, false, new CouponCallbackListener() {
            
	@Override
	public void run(Dialog dialog, ValidationResultModel CouponResult) {

	//Coupon usage result will be returned if showResultMsgToast is false.
	//Action after using coupon(ex. Move to notice, move to item shop, refresh item list)
	Log.d(tag, "showCouponDialog.Result ::: " + CouponResult.getResult());
	Log.d(tag, "showCouponDialog.Message ::: " + CouponResult.getMessage());
	Log.d(tag, "showCouponDialog.ItemKey ::: " + CouponResult.getItemKey());
	Log.d(tag, "showCouponDialog.ItemName ::: " + CouponResult.getItemName());
	Log.d(tag, "showCouponDialog.Quantity ::: " + CouponResult.getQuantity());

	}
});

Use Your UI

checkCoupon API should be used to transmit the coupon code entered by a user as parameter. The result will be returned accordingly.

IgawCoupon.checkCoupon(YourActivity.this, "{쿠폰번호}", new CouponCallbackListener() {

	@Override
	public void run(Dialog dialog, ValidationResultModel CouponResult) {

	//showResultMsgToast 를 false로 했을 경우 이 곳으로 쿠폰 사용 결과가 리턴됩니다.
	//쿠폰 사용 후 실행할 액션(ex. 아이템 확인 공지 노출, 상점 이동, 아이템 목록 갱신)
	Log.d(tag, "showCouponDialog.Result ::: " + CouponResult.getResult());
	Log.d(tag, "showCouponDialog.Message ::: " + CouponResult.getMessage());
	Log.d(tag, "showCouponDialog.ItemKey ::: " + CouponResult.getItemKey());
	Log.d(tag, "showCouponDialog.ItemName ::: " + CouponResult.getItemName());
	Log.d(tag, "showCouponDialog.Quantity ::: " + CouponResult.getQuantity());

	}
});



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 Guide]