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.

14.2.0

  • Please remove any use of the deprecated TJPlacementListener onClick method. It will be removed in the next major version and no longer does anything.
  • Please remove any use of the deprecated getSupportUrl method. It will be removed in the next major version and no longer does anything.

Manual Integration

There are two new activities to add to your manifest if you are integrating manually. These relate to the predictive back gesture.

<activity
    android:name="com.tapjoy.TJAdUnitActivity"
    android:enableOnBackInvokedCallback="false"
    android:configChanges="orientation|keyboardHidden|screenSize"
    android:theme="@style/TranslucentTheme"
    android:hardwareAccelerated="true"
    tools:ignore="UnusedAttribute" />
<activity
    android:name="com.tapjoy.TJWebViewActivity"
    android:enableOnBackInvokedCallback="false"
    android:configChanges="orientation|keyboardHidden|screenSize"
    android:theme="@style/TranslucentTheme"
    android:hardwareAccelerated="true"
    tools:ignore="UnusedAttribute" />

14.0.0

  • Please remove any use of Tapjoy.setActivity(). It will be removed in the next major version and no longer does anything.
  • Please remove any use of Tapjoy.setGLSurfaceView(). It will be removed in the next major version and no longer does anything.
  • Please replace uses of the deprecated method Tapjoy.trackPurchase() with trackPurchase(String currencyCode, double price).

13.4.0

We added a new connectWarning callback. This will fire when there is a non-blocking issue during connect, connectSuccess will also fire after. Currently this feature will only detect issues with UserId when sent in ConnectFlags.

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

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'
    }