Samsung Tizen setup for the SofAds SDK
Every Tizen app that uses SofAds needs webapis.js loaded before the SDK and the starter config.xml lines below: one access rule and four privileges, nothing else. SofAds doesn't need <tizen:allow-navigation>, and it can stop your app from working, so leave it out. Below are complete files you can copy.
Checklist
- Your Tizen application ID is on the listing in the dashboard.
<script src="$WEBAPIS/webapis/webapis.js">comes beforejs/sofads.min.jsinindex.html.- The starter config.xml lines are in your
config.xml:<access origin="*" subdomains="true">and the four privileges. Put them in your first release: published TV apps are rarely updated. - No
<tizen:allow-navigation>line for SofAds (why). - Your app's privacy policy has the lines from the privacy section.
- Video apps with AVPlay: load the SDK before you open AVPlay, and on a channel change show the ad first (AVPlay).
The full API is in the SofAds SDK reference, and the steps for every platform are on the release checklist.
Your Tizen application ID
When you add a Samsung Tizen listing, the dashboard asks for your Tizen application ID. It is the id of <tizen:application> in your config.xml: a package ID of 10 letters or digits, a dot and a name, for example AbCd123456.SnowStrike. Tizen Studio creates it with the project, and it stays the same for the life of the app.
<tizen:application id="AbCd123456.SnowStrike" package="AbCd123456" required_version="2.3"/>The SDK reads the same ID on the TV (tizen.application.getCurrentApplication().appInfo.id), so there is nothing to pass, and sends it with every request. A listing with an ID only accepts traffic from that app, so copy it exactly, capitals included. The store URL can wait until the app is live in the store.
index.html
The order matters. $WEBAPIS is a placeholder that the Tizen runtime fills in when it loads your page, so the tag has to be in your HTML; a script can't add it later. The SDK reads TIFA, Limit Ad Tracking and the model through webapis, so it must exist when the SDK starts.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My TV game</title>
<!-- 1. Samsung Web APIs. The Tizen runtime resolves $WEBAPIS, so this tag
must be in your HTML; the SofAds SDK cannot load it for you. -->
<script src="$WEBAPIS/webapis/webapis.js"></script>
<!-- 2. The SofAds SDK, bundled inside the .wgt package. -->
<script src="js/sofads.min.js"></script>
<!-- 3. Your app. -->
<script src="js/main.js" defer></script>
</head>
<body>
<canvas id="game" width="1920" height="1080"></canvas>
</body>
</html>js/main.js starts the SDK. The SDK reference has every option:
// js/main.js
SofAds.init({
appId: "sof_YOUR_APP_ID",
onPause: () => game.pause(), // stop your render loop before an ad plays
onResume: () => game.resume(),
});The SDK loads no other scripts: there is nothing else to add to your page.
config.xml
A complete config.xml with the starter lines. Keep your own application ID, package, name and icon; the SofAds part is between the marked comments.
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets"
id="http://example.com/mytvgame" version="1.0.0" viewmodes="maximized">
<tizen:application id="AbCdE12345.MyTvGame" package="AbCdE12345" required_version="2.3"/>
<tizen:profile name="tv-samsung"/>
<content src="index.html"/>
<icon src="icon.png"/>
<name>My TV game</name>
<tizen:setting screen-orientation="landscape" context-menu="enable"
background-support="disable" encryption="disable"
install-location="auto" hwkey-event="enable"/>
<!-- ============ SofAds starter setup: every app ============ -->
<access origin="*" subdomains="true"></access>
<tizen:privilege name="http://tizen.org/privilege/internet"/>
<tizen:privilege name="http://developer.samsung.com/privilege/adinfo"/>
<tizen:privilege name="http://developer.samsung.com/privilege/productinfo"/>
<tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
<!-- ============ end of SofAds starter setup ============ -->
</widget>The starter lines (every app)
| Line | Why SofAds needs it |
|---|---|
<access origin="*" subdomains="true"> | Network access to every host. See why everything. |
http://tizen.org/privilege/internet | Network access for ad requests, media and events. |
http://developer.samsung.com/privilege/adinfo | TIFA (the Tizen advertising ID) and the Limit Ad Tracking setting. |
http://developer.samsung.com/privilege/productinfo | TV model and firmware version. |
http://tizen.org/privilege/tv.inputdevice | Remote keys beyond the arrows and OK, such as BACK. |
App install ads (optional)
App install ads promote other Samsung TV apps; their Install button opens the app's page in the Samsung store. That needs one more privilege. Without it your app simply gets no app install ads, so it is optional, but add it in your first release if you want the extra fill:
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>The SDK reads config.xml at start-up (packaged apps) and only asks for app install ads when this line is there. Hosted apps get none.
Google demand
Google demand needs no extra lines. When SofAds adds Google, its ads arrive as plain video (VAST) ads, which the starter lines already cover. Earlier versions of this page listed extra Google privileges; they are no longer needed.
Why access to every host
<access origin="*"> lets the app reach any host. SofAds asks for it because the hosts an ad needs can't be known when you publish:
- Published apps are rarely updated. A TV app often stays on TVs for years in the version you submitted, so a host list written today would block what comes later.
- Partner ads load from their own hosts. Video ads from partners (VAST) bring media and tracking URLs on domains chosen by that partner, per ad.
- Future partners. The next partner will bring its own hosts.
SofAds itself keeps serving its own creatives from cdn.sofadsrv.com, so its own ads never depend on this rule. You don't need a separate entry for the serving domain or for any CDN.
Why there is no allow-navigation
Earlier versions of this page also listed <tizen:allow-navigation>*</tizen:allow-navigation>. Leave it out: SofAds doesn't need it, and apps stopped working on TVs with it. Tizen's documentation says an app with <tizen:allow-navigation> runs in the CSP-based security mode, which can block the scripts and styles your app relies on.
The rule only lets the top-level page move to another URL, and the SofAds SDK never does that. If you added it only for SofAds, remove it in your next release.
How the SDK keeps ads from navigating your app
The open access rule lets ads load media from any host, but never lets them take over your app. The protection lives in the SDK:
- HTML ads run in a sandboxed
<iframe>that allows scripts but notallow-top-navigationorallow-top-navigation-by-user-activation, so an ad can't replace your page (window.top.location,top.location.hrefandwindow.open(…, "_top")are all blocked). - The SDK itself never navigates the top-level page. A QR code is scanned with the viewer's phone, so a landing page never opens on the TV.
- Video ads play in the SDK's own player; their click-through URLs are never opened on the TV.
The CSP-based security mode
Tizen's documentation says that an app with <tizen:allow-navigation> runs in the CSP-based security mode, where the runtime may enforce a default Content Security Policy (default-src *; script-src 'self'; style-src 'self'; object-src 'none') unless config.xml sets one with <tizen:content-security-policy>. Inline scripts and styles then stop working, which can leave the app blank or unresponsive. That is why SofAds leaves the rule out. Samsung's review asks for a policy without unsafe-inline and unsafe-eval anyway, so files inside your package are the safe choice in every mode.
Hosted apps
A hosted app is a small .wgt that opens your app on your own website, so you can update the app without a store release.
Ask Samsung first. Samsung's hosted-applications FAQ says hosted apps are generally not accepted in the store, with rare exceptions: you need to be in a partner group and to contact your Content Manager before you build one. It also says Tizen APIs are not supported on hosted pages. That has two consequences for SofAds on the hosted part of your app:
- The SDK can't read TIFA, Limit Ad Tracking or the TV model there. It uses its own install ID and the user agent instead, as described under what happens when something is missing, so ads can't be personalized and some partners may not fill.
- Only the packaged page can use Tizen calls, such as closing the app on BACK.
Opening another URL from the packaged page is not part of the SofAds setup: follow Samsung's setup for hosted apps, and test the release build on a real TV before you submit. If Samsung accepts your hosted app, two rules keep SofAds working on the hosted site:
- One permanent domain per hosted app. The browser storage, and with it the SofAds install ID, belongs to the site's origin. Moving to another domain (or from
www.to the bare domain) starts every user over: frequency caps, test devices and analytics all see new users. - A pinned SDK version on the hosted site, for example
https://sdk.sofadsrv.com/sdk/v1.0.0/sofads.min.jsor a copy on your own site, never a "latest" URL. You choose when your app moves to a new SDK; the SDK changelog says what changed.
On the hosted site, load the pinned SDK and start it as in index.html. Samsung doesn't support Tizen APIs on hosted pages, so don't count on $WEBAPIS/webapis/webapis.js there: the SDK works without it, with its own install ID.
Video apps with AVPlay
On a Samsung TV the ad's video and your app's AVPlay player share one video pipeline. An ad that starts while AVPlay plays would freeze your stream for good: AVPlay keeps reporting PLAYING, but its picture stops and the screen stays black after the ad. The SDK prevents this for you:
- Right after your
onPause, before the ad's video exists, the SDK callswebapis.avplay.suspend()on an AVPlay that is ready, playing or paused. - Right after the ad, before your
onResume, it restores AVPlay withrestore()and callsplay()when the TV leaves it paused. Your stream continues where it was (live streams at the live edge).
You don't need to change any code for this. AVPlay continues with the URL it stored itself. On TVs where restore() needs the URL, the SDK uses the one your app passed to webapis.avplay.open(), which it remembers from the moment the SDK script runs. Your part:
Load the SDK before you open AVPlay, as in index.html. If your live URLs expire, pass the current URL yourself; the SDK then restores with it first:
jsSofAds.init({ appId: "sof_YOUR_APP_ID", tizen: { avplayUrl: () => stream.url }, // the URL AVPlay should continue with });On a channel change, show the ad first and open the new channel when the show call resolves. Opening a channel while the ad plays fails, because the ad holds the video pipeline:
jsasync function changeChannel(next) { await SofAds.showInterstitial({ placement: "channel_change" }); // resolves on no fill too openChannel(next); // webapis.avplay.close(), open(next.url), prepareAsync, play }Handing AVPlay over yourself instead: pass
tizen: { avplayHandover: false }, suspend or close AVPlay inonPause, and restore or reopen it inonResume.
If AVPlay can't be restored at all, the SDK logs one warning: SofAds: AVPlay could not be restored after the ad. We tested the handover on a Samsung UE43DU7172 (firmware 2130) with HLS streams and channel changes (November 2, 2026).
What happens when something is missing
The SDK never throws because of a setup mistake. It falls back and tells you once:
- No
webapis.js: the SDK uses its own install ID and the user agent instead of TIFA and the model, and logs one warning:SofAds: webapis.js not loaded; include $WEBAPIS/webapis/webapis.js before the SDK. - A missing privilege: when a call is refused with a
SecurityError, the SDK falls back the same way and logs one warning naming the privilege. - Both are reported with the session, so the publisher dashboard shows an integration warning on the listing, with the line to add and a link to this page.
Ads still work in both cases, but without TIFA they can't be personalized and some partners may not fill. More fixes are on the troubleshooting page.
Checked against Samsung and Tizen docs
We checked this setup against the current documentation on October 9, 2026:
<access>: Samsung documents<access origin="<SERVER_URL>" subdomains="true"></access>for external servers, and the W3C Widget Access Request Policy that Tizen follows definesorigin="*"as access to every network resource.<tizen:allow-navigation>: Tizen'sconfig.xmlreference lists it as the list of URL domains the app may navigate to (example:tizen.org *.tizen.org). Tizen's web runtime guide says it puts the app in the CSP-based security mode. SofAds doesn't need it, and apps stopped working on TVs with it (October 20, 2026), so the starter lines leave it out.- Privilege names:
tv.inputdeviceandproductinfoappear in Samsung's configuration guide,internetin Samsung's networking FAQ andadinfoin Samsung's AdInfo API reference (privilege level public). - Hosted apps: Samsung's hosted-applications FAQ says hosted apps are generally not accepted (rare exceptions, partner groups only, ask your Content Manager), that Tizen APIs are not supported in hosted apps, and that a content security policy may not use
unsafe-inlineorunsafe-eval.
Privacy policy lines for Tizen
Your app's privacy policy has to say that it shows ads and what data that involves. Copy these lines into it and adapt them to your app. They match the SofAds privacy policy. Treat the wording as a template and have it reviewed for your app; it is not legal advice. Which IDs the SDK reads, and when, is on the privacy and consent page.
This app shows ads from SofAds. To choose, show and measure ads, the app sends SofAds information about the app and the TV (platform, manufacturer, model, operating system version, screen size and language), your IP address, your consent choices and an advertising identifier where your choices allow it. For some ad partners the TV requests the ad directly from that partner, which then also receives your IP address. If this app has no consent screen of its own and you are in the EEA, the UK or Switzerland, the SofAds consent screen asks for your choice when the app starts; you can change it later in the app. Where no TV advertising identifier is available or allowed, SofAds uses a random install ID stored by this app, which you can reset in the app's privacy settings. SofAds privacy policy: https://sofads.com/privacy/
On Samsung TVs, the advertising identifier is the Tizen Identifier for Advertising (TIFA), sent together with your Limit Ad Tracking setting. You can reset TIFA and switch on Limit Ad Tracking in the TV's privacy settings; with Limit Ad Tracking on, only non-personalized ads are shown.
Next steps
Test your build before the listing goes live: until then every request gets test ads, and you can register your own TV as a test device. Skippable video gets a skip button; the SDK follows the skip button standard. Before you submit, go through the release checklist. For the platform's business side, see Tizen monetization.
Frequently asked questions
Why must webapis.js be loaded before the SofAds SDK?
The SDK reads TIFA, Limit Ad Tracking and the TV model through webapis when it starts. $WEBAPIS is resolved by the Tizen runtime, so only a script tag in your HTML can load it.
Why does SofAds ask for access to every host?
Published TV apps are rarely updated, and partner video ads and future partners load from hosts nobody can list in advance. The SDK sandboxes HTML ads and never navigates your page, so the open access rule doesn't let ads take over your app.
Do I need tizen:allow-navigation for SofAds?
No. The SDK never navigates your page. The rule puts your app in Tizen's CSP-based security mode, and apps stopped working on TVs with it, so leave it out.
Does a SofAds ad stop my AVPlay video?
No. The SDK suspends AVPlay for the ad and restores it afterwards, without any code change in your app (AVPlay). On a channel change, show the ad first and open the new channel after it.
Does Google demand need extra privileges?
No. Google ads come through SofAds as plain video ads, so the four starter privileges are all your app needs.
Does my app break if a privilege is missing?
No. The SDK falls back to its own install ID, logs one warning and reports it, so the publisher dashboard shows what to fix. Ads keep working, without the platform advertising ID.
Sources
Checked on October 9, 2026. Platform rules change; when a source and this page disagree, the source wins.
- Samsung Developers: Configuring TV applications (privileges)
- Samsung Developers: Networking and connectivity FAQ (access element, internet privilege)
- Samsung Developers: Hosted applications FAQ (hosted apps, Tizen APIs, CSP)
- Samsung Developers: AdInfo API reference
- Samsung Developers: Tizen Identifier for Advertising (TIFA)
- Tizen Docs: config.xml reference (tizen:allow-navigation, access, tizen:privilege, application ID and package ID)
- Tizen Docs: Web runtime, content security policy and the CSP-based security mode
- W3C: Widget Access Request Policy (origin="*")
Keep reading
- Test ads and test devices: what your app shows before its listing is live.
- Release checklist: everything to check before you submit.
- Tizen monetization: seller tiers, TIFA, Samsung Checkout and app-ads.txt.