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().then((value) {
2
print('Paid out $value rewards');
3
}, onError: (err) {
4
print('Error while paying out: $err');
5
});
Copied!
This method always pays out all rewards which the user has collected, i.e. the value of rewards['available_for_payout'].‌
If the user has not accepted the adjoe Terms of Service yet, this operation will fail and reason will be equal to 1. 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 0 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
Adjoe.doPayout(params);
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().then((rewards) {
2
int amount = rewards['reward'];
3
int available = rewards['available_for_payout'];
4
int spent = rewards['already_spent'];
5
print('Received rewards: $amount (= $available + $spent)');
6
}, onError: (err) {
7
print('Failed to request rewards: $err');
8
});
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
Adjoe.requestRewards(params);
Copied!
Last modified 24d ago