Other methods
There are some other methods in the adjoe SDK which you might find helpful.
name
description
GetVersion
Returns the internal version code of the adjoe SDK, for example 17.
GetVersionName
Returns the version name of the adjoe SDK, for example 1.2.0.
HasAcceptedTOS
Returns true if the user has accepted the adjoe TOS and false otherwise.
HasAcceptedUsagePermission
Returns true if the user has granted access to the app usage statistics and the adjoe SDK was initialized accordingly, false otherwise. Note that this method will always return true on devices with an Android API level smaller than 21.

Payout via SDK

The following information on SDK-side reward handling is only relevant for your integration if you cannot use Server-to-Server Payout. Do not implement these functions if you already successfully followed the steps in the Payout section - it could trigger error messages and unexpected behaviour.
If you cannot handle the payout requests via an endpoint on your server, we can also handle the reward payouts inside the SDK itself.
To pay out the rewards that the user has collected from partner apps directly in the SDK, call
1
Adjoe.DoPayout(AdjoePayoutSuccessListener, AdjoePayoutErrorListener);
2
3
public void AdjoePayoutSuccessListener(AdjoePayoutResponse response)
4
{
5
// the payout was executed successfully
6
7
//get the amount of paid out coins
8
int paidOutCoins = response.Coins;
9
}
10
11
public void AdjoePayoutErrorListener(AdjoePayoutError error)
12
{
13
// an error occurred while paying out the coins
14
15
// get information about why it failed
16
// 'reason' is one of
17
// - AdjoePayoutError.UNKNOWN
18
// - AdjoePayoutError.NOT_ENOUGH_COINS
19
// - AdjoePayoutError.TOS_NOT_ACCEPTED
20
int reason = error.Reason;
21
22
// if available, get more information about the error
23
if (error.Exception != null) {
24
Console.WriteLine(error.Exception.ToString());
25
}
26
}
Copied!
This method always pays out all rewards which the user has collected, i.e. the value of rewards.available_payout_coins.
If the user has not accepted the adjoe Terms of Service yet, this operation will fail and reason will be equal to Adjoe.PAYOUT_TOS_NOT_ACCEPTED. You might want to display the offerwall again so that the user can accept the adjoe Terms of Service. This operation will also fail with reason equal to Adjoe.PAYOUT_UNKNOWN if the user is blocked by the adjoe services.

Adjoe Parameters

You can pass additional UA and placement parameters when you pay out the rewards:
1
AdjoeParams adjoeParams = new AdjoeParams();
2
adjoeParams.SetUaNetwork("network")
3
.SetUaChannel("Channel")
4
.SetUaSubPublisherCleartext("SubPublisherCleartext")
5
.SetUaSubPublisherEncrypted("SubPublisherEncrypted")
6
.SetPlacement("placement");
7
Adjoe.DoPayout(adjoeParams, AdjoePayoutSuccessListener, AdjoePayoutErrorListener);
Copied!

Further Context on Rewards

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.
To do so call
1
Adjoe.RequestRewards(AdjoeRewardSuccess, AdjoeRewardError);
2
3
public void AdjoeRewardSucces(AdjoeRewardResponse response)
4
{
5
// successfully requested the rewards
6
7
// get the total amount of coins which the user has collected
8
int reward = response.Reward;
9
10
// get the amount of coins which are available for payout
11
int availableForPayout = response.AvailablePayoutCoins;
12
13
// get the amount of coins which the user has already spent
14
int alreadySpentCoins = response.AlreadySpentCoins;
15
}
16
17
public void AdjoeRewardError(AdjoeRewardResponseError error)
18
{
19
// an error occurred while requesting the rewards
20
21
// you can try to get additional information about the error for debugging
22
if (error.Exception != null) {
23
Console.WriteLine(error.Exception.ToString());
24
}
25
}
Copied!
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.

Adjoe Parameters

You can pass additional UA and placement parameters when you request the rewards:
1
AdjoeParams adjoeParams = new AdjoeParams();
2
adjoeParams.SetUaNetwork("network")
3
.SetUaChannel("Channel")
4
.SetUaSubPublisherCleartext("SubPublisherCleartext")
5
.SetUaSubPublisherEncrypted("SubPublisherEncrypted")
6
.SetPlacement("placement");
7
Adjoe.RequestRewards(adjoeParams, AdjoeRewardSuccess, AdjoeRewardError);
Copied!
Last modified 24d ago