Publication Viewer
Use our Publication Viewer to embed a full publication on your website or render it inside a native app via WebView. The viewer can be customized via URL parameters and works seamlessly across platforms.
🖥 Embedding in Websites (iframe)
You can embed any publication directly on your website using an <iframe>. Choose your layout and behavior using the viewer parameters.
<iframe
src="https://publication-viewer.tjek.com/v1/embeds/:publicationId?api_key=your_api_key&context=iframe&view_direction=vertical&view_mode=paged&ui=regular"
width="100%"
height="800">
</iframe>
📱 Embedding in Mobile Apps (WebView)
Render the viewer in a WebView inside your mobile app. Supported in all major frameworks:
✅ React Native
import { WebView } from 'react-native-webview';
<WebView
source=
onMessage={(event) => {
console.log(event.nativeEvent.data);
}}
/>
✅ Flutter
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Flutter WebView')),
body: WebViewExample(),
),
);
}
}
class WebViewExample extends StatefulWidget {
@override
WebViewExampleState createState() => WebViewExampleState();
}
class WebViewExampleState extends State<WebViewExample> {
@override
Widget build(BuildContext context) {
return WebView(
initialUrl: "https://publication-viewer.tjek.com/v1/embeds/:publicationId?api_key=your_api_key&context=webview&view_direction=vertical&view_mode=paged&ui=regular",
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
webViewController.evaluateJavascript('window.postMessage("hello from WebView");');
},
javascriptChannels: <JavascriptChannel>{
JavascriptChannel(
name: 'Tjek',
onMessageReceived: (JavascriptMessage message) {
print(message.message);
},
),
},
);
}
}
✅ Android (Kotlin)
webView.settings.javaScriptEnabled = true
webView.addJavascriptInterface(AndroidJSInterface(), "androidJSInterface")
webView.loadUrl("https://publication-viewer.tjek.com/v1/embeds/:publicationId?api_key=your_api_key&context=webview&view_direction=vertical&view_mode=paged&ui=regular")
webView.webViewClient = WebViewClient()
✅ iOS (Swift)
let contentController = WKUserContentController()
contentController.add(self, name: "tjek")
let config = WKWebViewConfiguration()
config.userContentController = contentController
webView = WKWebView(frame: self.view.frame, configuration: config)
let request = URLRequest(url: URL(string: "https://publication-viewer.tjek.com/v1/embeds/:publicationId?api_key=your_api_key&context=webview&view_direction=vertical&view_mode=paged&ui=regular")!)
webView.load(request)
🔗 Viewer URL Parameters
|
Parameter |
Values |
Description |
|---|---|---|
|
context |
webview, iframe, regular |
Context determines how the viewer is embedded |
|
view_direction |
vertical, horizontal |
Sets the scroll direction inside the viewer |
|
view_mode |
paged, continuous |
Display pages one by one or in a continuous flow |
|
ui |
regular, none |
Show or hide built-in navigation and UI |
📦 Fetching Offer & Product Data
When a user taps an offer inside the viewer, you can retrieve more information via the API.
For detailed information on fetching offer and product data, please refer to the API documentation at Tjek API Integration Help.