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

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
}

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:

AdjoeParams adjoeParams = new AdjoeParams.Builder()
                .setUaNetwork("network")
                .setUaChannel("channel")
                .setUaSubPublisherCleartext("SubPublisherCleartext")
                .setUaSubPublisherEncrypted("SubPublisherEncrypted")
                .setPlacement("placement")
                .build();
Adjoe.getOfferwallIntent(context, adjoeParams);

Listener

You can set a listener which notifies you when Playtime opens or closes via

Adjoe.setOfferwallListener(new AdjoeOfferwallListener() {

    @Override
    public void onOfferwallOpened(String type) {
        Log.d(TAG, "Offerwall of type '" + type + "' was opened");
    }

    @Override
    public void onOfferwallClosed(String type) {
        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
}

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 {
      // only use canShowOfferwall(context) for this purpose
      if(Adjoe.canShowOfferwall(context)) {
           Adjoe.sendUserEvent(context, Adjoe.EVENT_TEASER_SHOWN, null, adjoeParams);
      }
 } catch (AdjoeNotInitializedException e) {
      // you have to initialize the adjoe SDK
 }