(
+ () => ({
+ onRenderSuccessful: (placement, height) => {
+ console.log(
+ `[WebIntegration] onRenderSuccessful placement="${placement}" height=${height}`
+ );
+ },
+ onRenderFailed: (placement, error) => {
+ console.log(
+ `[WebIntegration] onRenderFailed placement="${placement}" error=${error}`
+ );
+ },
+ }),
+ []
+ );
+
+ // 3. Load the real content page once the bridge is registered.
+ const handleWebviewRegistered = useCallback(
+ (_controller: TBLWebUnitController) => {
+ setSource({ html: CONTENT_HTML, baseUrl: TABOOLA_CONTENT_BASE_URL });
+ },
+ []
+ );
+
+ const handleRegistrationFailed = useCallback(
+ ({ code, message }: { code: string; message: string }) => {
+ Alert.alert(`Registration failed: ${code}`, message);
+ },
+ []
+ );
+
+ return (
+
+ {/* 2. Wrap the publisher WebView. The wrapper attaches the Taboola
+ bridge; the WebView itself is fully publisher-owned. */}
+
+ = 0.81
+ // the string form (`"normal"`) is also accepted. No-op on Android.
+ decelerationRate={0.998}
+ webviewDebuggingEnabled={true}
+ style={styles.webView}
+ />
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: { flex: 1, backgroundColor: COLORS.BACKGROUND },
+ webView: { flex: 1 },
+});
+
+export default WebIntegrationScreen;
diff --git a/src/screens/webIntegration/taboolaPageHtml.ts b/src/screens/webIntegration/taboolaPageHtml.ts
new file mode 100644
index 0000000..f74381f
--- /dev/null
+++ b/src/screens/webIntegration/taboolaPageHtml.ts
@@ -0,0 +1,56 @@
+// Sample HTML page with a standard Taboola tag. In a real integration this
+// content comes from the publisher's CMS — nothing here is React-Native or
+// SDK specific. It is included in the sample only so the screen has a real
+// page to load.
+//
+// If you want to see what a minimal Taboola page looks like, this is it:
+// two containers (`taboola-rn-top`, `taboola-rn-bottom`), the mobile-loader
+// script, and one `_taboola.push({...})` per placement.
+export const buildTaboolaPageHtml = (params: {
+ publisherId: string;
+ topPlacement: string;
+ topMode: string;
+ bottomPlacement: string;
+ bottomMode: string;
+}): string => `
+
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum
+ mauris eget odio fermentum, non elementum lectus dapibus.
+ In aliquam arcu eget nisl imperdiet finibus. Nunc pharetra sapien felis,
+ vitae aliquam lorem bibendum in. Donec lacinia blandit tellus quis rutrum.
+
+
+
+`;
+
+export const TABOOLA_CONTENT_BASE_URL = 'https://cdn.taboola.com/mobile-sdk/init/';
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index bb68c1a..69d594d 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -74,6 +74,7 @@ export const SCREENS = {
SHOULD_HANDLE_ORGANIC_CLICKS_SCREEN: 'ShouldHandleOrganicClicksScreen',
GLOBAL_SETTINGS: 'GlobalSettings',
DARK_MODE: 'Dark Mode',
+ WEB_INTEGRATION: 'WebIntegration',
};
export const SCREEN_TITLES = {
@@ -84,6 +85,7 @@ export const SCREEN_TITLES = {
SHOULD_HANDLE_ORGANIC_CLICKS_SCREEN: 'Should Handle OC Screen',
GLOBAL_SETTINGS: 'Global Settings Screen',
DARK_MODE: 'Dark Mode Screen',
+ WEB_INTEGRATION: 'Web Integration Screen',
};
export const PLACEMENT_PARAMS = {