The Playtime 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
try {Intent adjoeOfferwallIntent =Adjoe.getOfferwallIntent(context);context.startActivity(adjoeOfferwallIntent);} catch(AdjoeNotInitializedException notInitializedException) {// you have not initialized the adjoe SDK} catch(AdjoeException exception) {// the offerwall cannot be displayed for some other reason}
try {val adjoeOfferwallIntent = Adjoe.getOfferwallIntent(context) context.startActivity(adjoeOfferwallIntent)} catch(notInitializedException: AdjoeNotInitializedException) {// you have not initialized the adjoe SDK} catch(exception: AdjoeException) {// the offerwall cannot be displayed for some other reason}
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.
Before the user can interact with the partner apps on their feed, 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 Intent:
You can set a listener which notifies you when Playtime opens or closes via
Adjoe.setOfferwallListener(newAdjoeOfferwallListener() { @OverridepublicvoidonOfferwallOpened(String type) {Log.d(TAG,"Offerwall of type '"+ type +"' was opened"); } @OverridepublicvoidonOfferwallClosed(String type) {Log.d(TAG,"Offerwall of type '"+ type +"' was closed"); }});
Adjoe.setOfferwallListener(object:AdjoeOfferwallListener() {funonOfferwallOpened(type:String) { Log.d(TAG, "Offerwall of type '"+ type +"' was opened") }funonOfferwallClosed(type:String) { Log.d(TAG, "Offerwall of type '"+ type +"' was closed") }})
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.
try {Adjoe.sendUserEvent(context,Adjoe.EVENT_TEASER_SHOWN,null, adjoeParams);} catch (AdjoeNotInitializedException e) {// you have to initialize the adjoe SDK}
try { Adjoe.senduserEvent(context, Adjoe.EVENT_TEASER_SHOWN, null, "<subId1>", "<subId2>")} catch (AdjoeNotInitializedException e) {// you have to initialize the adjoe SDK}
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.
try {
if(Adjoe.canShowOfferwall(context)) {
// show teaser view e.g button
// mTeaserButton.setVisibility(View.VISIBLE);
Adjoe.sendUserEvent(context, Adjoe.EVENT_TEASER_SHOWN, null, adjoeParams);
}
} catch (AdjoeNotInitializedException e) {
// you have to initialize the adjoe SDK
}