Deeper Dive (Beta)
Basic requirementsBefore you start, make sure that you meet the basic requirements:
- You are using Android Classic as your integration method.
- You are using Taboola SDK
4.0.25or higher.- Your Taboola Account Manager has instructed you to go ahead with the Deeper Dive integration.
Need a hand? Please reach out to your Taboola Account Manager.
Overview
Deeper Dive adds an AI-powered question-and-answer unit to your page. Users can tap suggested questions or submit their own questions and continue the experience in a full-screen bottom sheet, while staying inside your app flow.
First steps
Complete the Basic Integration steps first.
Page type behavior
The Deeper Dive experience depends on the page type that you set on TBLClassicPage:
Page type behavior
article- The unit includes suggested questions.homepage- The unit loads without suggested questions.
Set the page type before creating the Deeper Dive unit:
classicPage.setPageType("article"); // With suggested questions
classicPage.setPageType("homepage"); // Without suggested questionsclassicPage.setPageType("article") // With suggested questions
classicPage.setPageType("homepage") // Without suggested questionsEnable the feature
Create Deeper Dive using the TBLClassicPage instance that you have already created.
TBLClassicDeeperDiveUnit deeperDiveUnit = classicPage.createDeeperDiveUnit(
fragmentManager,
listener
);val deeperDiveUnit = classicPage.createDeeperDiveUnit(
fragmentManager,
listener
)
Parameters
fragmentManager- TheFragmentManagerused to display the Deeper Dive bottom sheet.listener- A class instance that implementsTBLClassicDeeperDiveListener.
Add the unit to your layout
Add the returned TBLClassicDeeperDiveUnit view to a parent container in your screen.
<FrameLayout
android:id="@+id/deeper_dive_container_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />FrameLayout container = findViewById(R.id.deeper_dive_container_view);
container.addView(deeperDiveUnit);val container = findViewById<FrameLayout>(R.id.deeper_dive_container_view)
container.addView(deeperDiveUnit)Load content
Call fetchContent() after the unit is attached to the layout.
deeperDiveUnit.fetchContent();deeperDiveUnit.fetchContent()
ImportantCall
fetchContent()once the unit is ready in the view hierarchy (for example, right afteraddViewin your screen setup).
Event handling
TBLClassicDeeperDiveListener
To get notified about Deeper Dive events, implement TBLClassicDeeperDiveListener:
TBLClassicDeeperDiveListener listener = new TBLClassicDeeperDiveListener() {
@Override
public void onDeeperDiveLoaded() {
super.onDeeperDiveLoaded();
// Called when Deeper Dive content is loaded
}
@Override
public void onDeeperDiveLoadFailedWithError(String error) {
super.onDeeperDiveLoadFailedWithError(error);
// Handle error here
}
};val listener = object : TBLClassicDeeperDiveListener() {
override fun onDeeperDiveLoaded() {
super.onDeeperDiveLoaded()
// Called when Deeper Dive content is loaded
}
override fun onDeeperDiveLoadFailedWithError(error: String) {
super.onDeeperDiveLoadFailedWithError(error)
// Handle error here
}
}
Automatic bottom sheet behaviorThe SDK opens the Deeper Dive bottom sheet automatically when the user taps a question in the unit.
Sample AppWhile reading the documentation, take a look at our Sample App.
Updated about 8 hours ago
