Playtime/Advance Access
The Playtime/Advance feed contains the apps which the users can install and use to gain rewards. 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.

Launching Playtime

To launch Playtime, 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 ad feed. If you need to know in advance whether the user will see the feed or not, you can call Adjoe.canShowOfferwall(Context). This method will return true if the user can see the regular ad feed and false otherwise, but don't use to condition the above method Adjoe.getOfferwallIntent(context). Use Adjoe.canShowOfferwall(context) to trigger the teaser event as explained below.
Before the user can interact with the partner apps on their feed, he has to accept the adjoe Terms of Service and optionally 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 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 Playtime 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 Playtime can be accessed by the user before showing the teaser button.
1
try {
2
// only use canShowOfferwall(context) for this purpose
3
if(Adjoe.canShowOfferwall(context)) {
4
Adjoe.sendUserEvent(context, Adjoe.EVENT_TEASER_SHOWN, null, adjoeParams);
5
}
6
} catch (AdjoeNotInitializedException e) {
7
// you have to initialize the adjoe SDK
8
}
Copied!