로딩중입니다
Client Reward Integration : Android
5/27/2015 11:24:00 AM

IGAW Reward Server Integration: Android

In case the internal server to receive callbacks from the IGAW reward server is difficult to set up, the additional client integration can be achieved to treat reward. 



AndroidManifest.xml

To treat reward callbacks through the client, the reward server integration system should be edited.

Set the reward server integration method within the <application></application> tags as client as below.

<meta-data android:name="igaworks_reward_server_type" android:value="client"/>




Register & Implement Reward Event Listener

Register and implement an event listener to receive a set of reward information transmitted from the IGAW reward server.

 

Listener: Detailed Description

1. onGetRewardInfo(boolean isSuccess, String resultMsg, IgawRewardItem[] rewardItems)

Unresolved reward information in the IGAW reward server is being delivered.

Reward information is delivered in the rewardItem[i] alignment in the IgawRewardItem type and the alignment contains the following:

  1. rewardItem[i].getCampaignKey() : Key for the user completed campaign.
  2. rewardItem[i].getCampaignTitle() : Name for the user completed campaign.
  3. rewardItem[i].getRTID() : Completed transaction ID
  4. rewardItem[i].getRewardQauntity() : Virtual currency amount given to the user.
  5. rewardItem[i].didGiveRewardItem() : API sent to the IGAW server notifying that reward distribution has been completed. 


Rewards will be given to users based on the information specified from no. 1 through 4 listed above. The didGiveRewardItem api in no. 5 will then be called up to notify the IGAW reward server.

 

2. onDidGiveRewardItemResult(boolean isSuccess, String resultMsg, int resultCode, String completedRewardKey)

The results of the callup didGiveRewardItem API above will be delivered. Use the delivered completedRewardKey for duplicate reward prevention and other functions.

IgawCommon.setClientRewardEventListener(new IgawRewardItemEventListener() {
	@Override
	public void onGetRewardInfo(boolean isSuccess, String resultMsg, IgawRewardItem[] rewardItems) {
 		for (IgawRewardItem rewardItem : rewardItems) {
			   //Provides a reward to users based on the following information.
                        rewardItem.getCampaignKey();
			rewardItem.getCampaignTitle();
			rewardItem.getRTID();
			rewardItem.getRewardQuantity();
			
			 //didGiveRewardItem is called up to notify the IGAW reward server that rewards have been distributed.
			rewardItem.didGiveRewardItem();
		}
	}

	@Override
	public void onDidGiveRewardItemResult(boolean isSuccess, String resultMsg, int resultCode, String completedRewardKey) {
		 // TODO Auto-generated method stub
                        //Duplicate usage of coupons can be restricted by applying the completedRewardKey.
	}
});


Reward Information Request

Reward event listener is called up when the OfferWall begins or ends. In case there is a set of reward information that needs to be treated in the IGAW reward server, that information is transmitted, too.

If you want to view the reward information for this case, you can call up the API below and view it through the IGAW reward server.

IgawAdpopcornExtension.getClientPendingRewardItems(MainActivity.this);



Integration Test


Participate in and complete a test ad from the test device set in [Manage OfferWall > QA & Optimize > Set Test Device] in the adPOPcorn admin page. If it can be verified that the rewards have been distributed from that app, the integration is in working order.