Offerwall
The offerwall contains the UI to show the user the rewarded apps which he can install and use. It is contained in a separate activity. We don't start the activity directly but instead provide you with an Intent to start it. This allows you to show your users a transition animation, among other things.

Displaying the offerwall

To display the offerwall call
Java
Kotlin
1
try {
2
Intent adjoeOfferwallIntent = Adjoe.getOfferwallIntent(context);
3
context.startActivity(adjoeOfferwallIntent);
4
} catch(AdjoeNotInitializedException notInitializedException) {
5
// you have not initialized the adjoe SDK
6
} catch(AdjoeException exception) {
7
// the offerwall cannot be displayed for some other reason
8
}
Copied!
1
try {
2
val adjoeOfferwallIntent = Adjoe.getOfferwallIntent(context)
3
context.startActivity(adjoeOfferwallIntent)
4
} catch(notInitializedException: AdjoeNotInitializedException) {
5
// you have not initialized the adjoe SDK
6
} catch(exception: AdjoeException) {
7
// the offerwall cannot be displayed for some other reason
8
}
Copied!
This will launch the AdjoeActivity displaying the adjoe offerwall. If you need to know in advance whether the user will see the offerwall or not, you can call Adjoe.canShowOfferwall(Context). This method will return true if the user can see the regular offerwall and false otherwise.
Before the user can interact with the partner apps on our offerwall, he has to accept the adjoe Terms of Service and grant your app permission to track the usage of other apps in his phone settings.
Adjoe Parameters You can pass additional UA and placement parameters when you get the offerwall Intent:
Java
Kotlin
1
AdjoeParams adjoeParams = new AdjoeParams.Builder()
2
.setUaNetwork("network")
3
.setUaChannel("channel")
4
.setUaSubPublisherCleartext("SubPublisherCleartext")
5
.setUaSubPublisherEncrypted("SubPublisherEncrypted")
6
.setPlacement("placement")
7
.build();
8
Adjoe.getOfferwallIntent(context, adjoeParams);
Copied!
1
val adjoeParams = AdjoeParams.Builder()
2
.setUaNetwork("network")
3
.setUaChannel("channel")
4
.setUaSubPublisherCleartext("SubPublisherCleartext")
5
.setUaSubPublisherEncrypted("SubPublisherEncrypted")
6
.setPlacement("placement")
7
.build()
8
Adjoe.getOfferwallIntent(context, adjoeParams)
Copied!

Listener

You can set a listener which notifies you when the offerwall opens or closes via
Java
Kotlin
1
Adjoe.setOfferwallListener(new AdjoeOfferwallListener() {
2
3
@Override
4
public void onOfferwallOpened(String type) {
5
Log.d(TAG, "Offerwall of type '" + type + "' was opened");
6
}
7
8
@Override
9
public void onOfferwallClosed(String type) {
10
Log.d(TAG, "Offerwall of type '" + type + "' was closed");
11
}
12
});
Copied!
1
Adjoe.setOfferwallListener(object:AdjoeOfferwallListener() {
2
fun onOfferwallOpened(type:String) {
3
Log.d(TAG, "Offerwall of type '" + type + "' was opened")
4
}
5
fun onOfferwallClosed(type:String) {
6
Log.d(TAG, "Offerwall of type '" + type + "' was closed")
7
}
8
})
Copied!
The type will always be offerwall.
You can remove the listener again by calling Adjoe.removeOfferwallListener().

teaser_shown event

You should send the teaser_shown event when the user can see the teaser, e.g. the button via which the user can access the adjoe SDK from your app. Trigger this event when the teaser has been successfully rendered and would successfully redirect the user to the adjoe SDK. It should be triggered regardless of whether the user has actually clicked the teaser or not. This event is mostly appropriate for uses, in which the functionality of the SDK App and SDK are kept separate to a relevant degree.
Java
Kotlin
1
try {
2
Adjoe.sendUserEvent(context, Adjoe.EVENT_TEASER_SHOWN, null, adjoeParams);
3
} catch (AdjoeNotInitializedException e) {
4
// you have to initialize the adjoe SDK
5
}
Copied!
1
try {
2
Adjoe.senduserEvent(context, Adjoe.EVENT_TEASER_SHOWN, null, "<subId1>", "<subId2>")
3
} catch (AdjoeNotInitializedException e) {
4
// you have to initialize the adjoe SDK
5
}
Copied!

Best practices for teaser_shown event

It's always good to check if the offerwall can be shown to the user before showing the teaser button.
1
try {
2
if(Adjoe.canShowOfferwall(context)) {
3
// show teaser view e.g button
4
// mTeaserButton.setVisibility(View.VISIBLE);
5
Adjoe.sendUserEvent(context, Adjoe.EVENT_TEASER_SHOWN, null, adjoeParams);
6
}
7
} catch (AdjoeNotInitializedException e) {
8
// you have to initialize the adjoe SDK
9
}
Copied!
Last modified 7mo ago