AppLixir Reward Management System does the following:
- Verifies the ad execution process to ensure users qualify for a reward.
- Employs anti scripting features to prevent cheating and maintain profitability
- Sets and enforces the maximum number of daily rewards per-user (using a dynamic 24 hour period)
- Sets and enforces the minimum time between reward video ad calls
The AppLixir Reward Management System uses an HTTP endpoint call to relay the reward events to your server. This setup requires:
- Enabling reward events
To enable reward events to be sent to the game server, add the following parameters to the options field while invoking invokeApplixirVideoUnit method.
Field | Description |
accountId | Account Id of the user as shown in the Games panel in the Applixir Web application. Required. |
gameId | Game Id, specific to the game, shown in the Applixir Web Application. Required. |
userId | Unique user Id of the logged in user playing the game. Typically a GUID, required. |
custom | Any custom data to be sent to the backend server. The data should be sent in JSON format. Optional. |
For example, the following html code snippet shows the changes required for setting up RMS.
<body>
<button type="button" id="playButton">Watch Video</button> // Create a button to initiate the video loading
<script type="text/javascript" src="https://cdn.applixir.com/applixir.sdk3.0m.js"></script> // Applixir SDK
<div id="applixir_vanishing_div" hidden>
<iframe id="applixir_parent"></iframe>
</div>
<script type="application/javascript">
function adStatusCallback(status) { // Status Callback Method
console.log('Ad Status: ' + status);
}
var options = { // Video Ad Options
zoneId: 2050,
accountId: xxxx, // Required field for RMS
gameId: yyyy, // Required field for RMS
adStatusCb: adStatusCallback,
userId: currentUserID(), // UUID4 recommended
custom: currentUserReward(),
};
playBtn = document.getElementById("playButton");
playBtn.onclick = function () {
invokeApplixirVideoUnit(options); // Invoke Video ad
}
</script>
</body>
2. Configuring the RMS properties in the AppLixir application
Follow the steps listed below to do the settings:
- Go to the AppLixir application.
- Go to the Account Settings and click CALLBACKS.
3. Set the properties and click Save. The table below explains all the fields for the RMS endpoint.
Endpoint Testing: We recommend using Webhook.site for testing your endpoint calls. It only takes a couple of minutes to setup and you can easily see your data and correct any issues there. The endpoint URL format is the same as below except it will reference www.webhook.site/<your-unique-webhook-ID>
Endpoint URL Format: After successfully setting up the reward events, whenever the Applixir application receives an event, it is relayed to the game server. The endpoint is invoked with the parameters in the following format.
https://www.yourdomain.com/yourendpoint?account_id={ACCOUNT_ID}&game_id={GAME_ID}&user_id={USER_ID}&custom={CUSTOM}×tamp={CALLBACK_TIMESTAMP}&uniquetid={UNIQUETID}&checksum={CHECKSUM}
The values in { } will automatically be replaced by the server at run-time.
Note: Do NOT use the {UNIQUETID} parameter for “MD5 Only” mode and don’t use {UNIQUETID} or {CHECKSUM} parameters for “No MD5 or TID” mode.
Following table describes the fields in the RMS endpoint call.
Key points to note:
- It is recommended to use the ‘MD5 and TID’ as the RMS mode.
- When computing MD5 hash in the end-point code, concatenate all the parameters you are using along with the callback secret with no separators between the values as shown in the example below (the order is important):
md5(accountId+gameId+userId+custom+uniquetid+timestamp+callbackSecret);
When processing the parameters received at your endpoint:
- Always verify that the current timestamp is later than the previous timestamp received.
- Ensure that the TID is different than the previous TID received.
- Never use the callback secret in JavaScript or anywhere else it can be seen by hackers.
- Rate limiting and daily reward limits are applicable only when the callback mode is set to ‘MD5 and TID’ and a valid user ID is provided in the options passed to invokeApplixirVideoUnit.