Advanced Options
Android Web - Advanced Options
You are viewing the V4 docs. This is the preferred version for Android.
To select an earlier version, use the nav bar (above):
While reading the documentation, take a look at our Sample App.
Introduction
In this section, we look at more advanced options for working with the Taboola SDK.
Opening Audience Exchange (AE) Items in App
If your widget or feed feature AE items and you wish to open these items within the app instead of an external web view, please see the following steps below.
1: Add the extra property 'allowAudienceExchangeClickOverride' to Taboola's global properties:
HashMap<String, String> extraProperties = new HashMap<String, String>() {{ put("allowAudienceExchangeClickOverride", "true"); }};
Taboola.setGlobalExtraProperties(extraProperties);
2: Override the onItemClick Listener to implement your desired behavior:
TBLWebUnit tblWebUnit =
tblWebPage.build(<Context>, <placementName>, <mode>, <placementType>, new TBLWebListener(){
@Override
onItemClick(String placementName, String itemId, String clickUrl, boolean isOrganic, @Nullable String customData) {
try {
data = new JSONObject(customData);
if (data.has("isAudienceExchange") && data.optBoolean("isAudienceExchange", false) {
// Handle Audience Exchange items
return false;
}
} catch (Exception exception) {
exception.printStackTrace();
}
return true;
});
Updated 8 months ago