AdInfo API
To use Samsung Product API,
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
Should be loaded in index.html
This module defines the identification information for advertising functionalities provided by the Tizen Samsung Product API.
Since : 2.4
Product : TV
Privilege Level : Public
Privilege : http://developer.samsung.com/privilege/adinfo
Remark :
- If you want the application to support 2015 TV models, in the "config.xml" file, set the `required_version` attribute to "2.3" and the development API version meta data to "2.4"
Summary of Interfaces and Methods
1. Interfaces
1.1 AdInfoManagerObject
Defines a WebApi object instance of the Tizen Samsung Product API.
The webapis.adinfo object enables access to AdInfo API functionality.
[NoInterfaceObject] interface AdInfoManagerObject {
readonly attribute AdInfoManager adinfo;
};
WebApi implements AdInfoManagerObject;
Attributes
1.2 AdInfoManager
Provides methods for AdInfo functionalities.
[NoInterfaceObject] interface AdInfoManager {
DOMString getVersion();
DOMString getTIFA();
boolean isLATEnabled();
};
Methods
getVersion
Retrieves the plugin version number.
DOMString getVersion();
Product : TV
Privilege Level : Public
Privilege : http://developer.samsung.com/privilege/adinfo
Return Value :
- DOMString : Plugin version
Exceptions :
- WebAPIException
- with error type SecurityError, if the application does not have the privilege to call this method.
Code Example :
try {
var value = webapis.adinfo.getVersion();
console.log(" version value = " + value);
} catch (e) {
if(e.message.indexOf('undefined') == -1) {
// Error, such as a missing privilege
} else {
// Undefined error
// Older firmware and models do not support this method
// Consider using a legacy method
}
}
getTIFA
TIFA is a randomized and non-persistent Samsung Smart TV device identifier that can be reset.
Personal information collected for the purpose of serving advertisements ("TIFA information") is linked to the TIFA. TIFA information must be used complying with all applicable privacy and data protection laws and regulations, including user consent.
The TIFA can be used for specific purposes only:
- Serving in-app advertisements
- Installing applications through your in-app advertisement
- Launching applications through your in-app advertisement, such as another application on the device, the Web browser, or a video player
- Collecting application usage data related to in-app advertisements, such as in-app purchases or subscriptions, for analyzing in-app advertisement attribution
When transferring the TIFA on the network, you must use an encrypted protocol such as HTTPS.
The TIFA cannot be associated with personally-identifiable information or any persistent device identifier, such as the DUID or MAC address. The user can generate a new TIFA at any time. You must not map or connect data from any previous TIFA to the new TIFA.
DOMString getTIFA();
Product : TV
Privilege Level : Public
Privilege : http://developer.samsung.com/privilege/adinfo
Return Value :
- DOMString : Advertising identifier
Exceptions :
- WebAPIException
- with error type SecurityError, if the application does not have the privilege to call this method.
- with error type InvalidStateError, if the PSID value is null.
Code Example :
try {
var value = webapis.adinfo.getTIFA();
console.log(" getTIFA value = " + value);
} catch (e) {
if(e.message.indexOf('undefined') == -1) {
// Error, such as a missing privilege
} else {
// Undefined error
// Older firmware and models do not support this method
// Consider using a legacy method
}
}
isLATEnabled
Checks whether the user has enabled the Limit Ad Tracking feature.
boolean isLATEnabled();
Product : TV
Privilege Level : Public
Privilege : http://developer.samsung.com/privilege/adinfo
Return Value :
- boolean : boolean value value to indicate whether limited ad tracking is set.
true: Limit Ad Tracking is enabled
false: Limit Ad Tracking is disabled
Exceptions :
- WebAPIException
- with error type SecurityError, if the application does not have the privilege to call this method.
Code Example :
try {
var value = webapis.adinfo.isLATEnabled();
console.log(" isLATEnabled value = " + value);
} catch (e) {
if(e.message.indexOf('undefined') == -1) {
// Error, such as a missing privilege
} else {
// Undefined error
// Older firmware and models do not support this method
// Consider using a legacy method
}
}
2. Full WebIDL
module AdInfo {
[NoInterfaceObject] interface AdInfoManagerObject {
readonly attribute AdInfoManager adinfo;
};
WebApi implements AdInfoManagerObject;
[NoInterfaceObject] interface AdInfoManager {
DOMString getVersion();
DOMString getTIFA();
boolean isLATEnabled();
};
};