maven { url "https://sdk.tapjoy.com/"}
implementation 'com.ironsource.adapters:tapjoyadapter:4.1.23'
implementation 'com.tapjoy:tapjoy-android-sdk:12.11.1'
You can find the latest adapter version here.
import com.tapjoy.Tapjoy;
Hashtable<String, Object> connectFlags = new
Hashtable<String, Object>();
Tapjoy.connect(getApplicationContext(), "TJ_SDK_KEY", connectFlags, new TJConnectListener() {
@Override
public void onConnectSuccess() {
}
@Override
public void onConnectFailure() {
}
});
private TJPlacementListener placementListener = this;
private TJPlacement placement;
placement = Tapjoy.getPlacement("Offerwall", placementListener);
placement.requestContent();
public void onRequestSuccess(TJPlacement placement);
public void onRequestFailure(TJPlacement placement, TJError error);
public void onContentReady(TJPlacement placement);
public void onContentShow(TJPlacement placement);
public void onContentDismiss(TJPlacement placement);
public void onPurchaseRequest(TJPlacement placement, TJActionRequest request, String productId);
public void onRewardRequest(TJPlacement placement, TJActionRequest request, String itemId, int quantity);
public void onClick(TJPlacement placement);
Some of these can replace the ironSource callbacks (available via the OfferwallListener
) you may have already implemented. You can see the corresponding callbacks in the table below so that you can easily move any custom logic into the appropriate Tapjoy callbacks:
ironSource Callback | Tapjoy Callback |
---|---|
onOfferwallOpened | onContentShow |
onOfferwallClosed | onContentDismiss |
onOfferwallAvailable | onContentReady |
onRequestSuccess
will be called when the content request returns from Tapjoy’s servers. onContentReady
will be called when the content (Offerwall) is ready to display. At this point you can either display Offerwall, or set some flag so that you know it is ready to display when you need it.
showContent
:if(placement.isContentReady()) {
placement.showContent();
}
This will replace your existing ironSource call:
IronSource.showOfferwall();
Once the user has dismissed the Offerwall you must request the content again. You cannot show a placement multiple times. We would recommend that you request the placement in the onContentDismiss
callback so that it is ready to display again the next time a user requests it.
You can now remove any remaining ironSource Offerwall code. For example, you no longer need to set the ironSource Offerwall listener and if your class implements “OfferwallListener” you should remove this reference.
If you are using ironSource LevelPlay, you may use LevelPlay APIs to share with Tapjoy the following privacy flags:
Also, if your app participates in Google Play’s Designed for Families program, or appears in the “Family” section of Google Play, please flag all the app's users as children and use this API of the Tapjoy SDK so that we don't collect the user's GAID.
If you are not using ironSource LevelPlay or if you would like to configure Tapjoy's SDK separately, please follow these guidelines to share with Tapjoy the relevant privacy flags.