Update Guide

This guide describes steps required when updating from one Tapjoy SDK version to another, it's recommended you perform all the steps to prevent any issues or conflicts.

13.2.0

Connect

We added error code & message parameters to connectFailure callback. The previous callback is now deprecated but still functional.

Tapjoy.connect(getContext().getApplicationContext(), "SDK_KEY_GOES_HERE", connectFlags, new TJConnectListener() {
    @Override
    public void onConnectSuccess() {
        super.onConnectSuccess();
    }    
    @Override
    public void onConnectFailure(int code, String message) {
        super.onConnectFailure(code, message);
    }    
    @Override
    public void onConnectFailure() { //Deprecated
        super.onConnectFailure();
    }
}); 

Max User Level

It's now possible to set the number of levels in your game. It can be set before or after connect.

Tapjoy.setMaxLevel(10); 

User Segment

You can now set the type of user currently using your app. This can be set before or after connect, or during the session.

Tapjoy.setUserSegment(TJSegment.VIP);
Tapjoy.setUserSegment(TJSegment.PAYER);
Tapjoy.setUserSegment(TJSegment.NON_PAYER);
Tapjoy.setUserSegment(TJSegment.UNKNOWN); 

Entry Point

Before calling request connect you can set the entry point. This describes where in the app the placement will be shown. You can choose from one of several preset values.

TJPlacement placement = Tapjoy.getPlacement("myPlacement", null);
placement.setEntryPoint(TJEntryPoint.ENTRY_POINT_MAIN_MENU);
placement.requestContent(); 

// Available values
TJEntryPoint.ENTRY_POINT_UNKNOWN
TJEntryPoint.ENTRY_POINT_OTHER
TJEntryPoint.ENTRY_POINT_MAIN_MENU
TJEntryPoint.ENTRY_POINT_HUD
TJEntryPoint.ENTRY_POINT_EXIT
TJEntryPoint.ENTRY_POINT_FAIL
TJEntryPoint.ENTRY_POINT_COMPLETE
TJEntryPoint.ENTRY_POINT_INBOX
TJEntryPoint.ENTRY_POINT_INIT
TJEntryPoint.ENTRY_POINT_STORE 

Currency

  • Get/spend/earn will no longer accept negative values.
  • If self-managed currencies call the managed currency API's, an error will be returned.

You can now set the users balance before creating a placement. It must be set before requestContent.

TJPlacement placement = Tapjoy.getPlacement("placement", this);
placement.setCurrencyBalance("1234", 100, new TJSetCurrencyBalanceListener() {
    @Override
    public void onSetCurrencyBalanceSuccess() {
        
    }

    @Override
    public void onSetCurrencyBalanceFailure(int code, String error) {

    }
}); 

You can also set the amount of currency a user needs to achieve their goal on each placement.

TJPlacement placement = Tapjoy.getPlacement("placement", this);
placement.setCurrencyAmountRequired("1234", 100, new TJSetCurrencyAmountRequiredListener() {
    @Override
    public void onSetCurrencyAmountRequiredSuccess() {
        
    }

    @Override
    public void onSetCurrencyAmountRequiredFailure(int code, String error) {

    }
});

12.8.0

Tapjoy now hosts our own maven repository. Bintray will continue to work in the short term, but as it is deprecated we recommend updating to use our repository as soon as you can.

All previous and new releases are available via our repository while only releases pre-12.8.0 will be available going forward on Bintray.

You can use the new repository like so:

    repositories {
      maven {
        name "Tapjoy's maven repo"
        url "https://sdk.tapjoy.com/"
      }
    }

    dependencies {
      api 'com.tapjoy:tapjoy-android-sdk:12.8.0@aar'
    }