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

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 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:

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 the offerwall 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 the offerwall can be shown to 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
 }

Last updated