You can get information about the rewards that the user has collected as well as about how many rewards are available for payout and how many the user has already spent.
Copy import io.adjoe.sdk.AdjoeRewardsEvent;
...
private function requestAdjoeRewards():void {
adjoe.addEventListener( "onRewardsReceived" , onRewardsReceived);
adjoe.addEventListener( "onRewardsError" , onRewardsError);
adjoe.requestRewards();
}
private function onRewardsReceived(event:AdjoeRewardsEvent):void {
trace( "Received adjoe rewards. Reward = " + event.getReward() +
", availablePayoutCoins = " + event.getAvailablePayoutCoins() +
", alreadySpentCoins = " + event.getAlreadySpentCoins());
}
private function onRewardsError(event:AdjoeRewardsEvent):void {
trace( "Adjoe rewards error: " + event.getErrorMessage());
}
This operation will fail if the SDK is not initialized, the user has not accepted the adjoe Terms of Service or is blocked by the adjoe services.
Copy var adjoeParams:AdjoeParams = new AdjoeParams();
adjoeParams.setUaNetwork("uaNetwork");
adjoeParams.setUaChannel("UaChannel");
adjoeParams.setUaSubPublisherCleartext("UaSubPublisherCleartext");
adjoeParams.setUaSubPublisherEncrypted("UaSubPublisherEncrypted");
adjoeParams.setPlacement("Placement");
adjoe.requestRewards(adjoeParams);