To use Samsung Product API,
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
Should be loaded in index.html
Since : 2.3
Product : TV, AV_BD
Privilege level: Partner
Privilege: http://developer.samsung.com/privilege/sso.partner
Interface | Method |
---|---|
SsoManagerObject | |
SsoManager | void showAccountView(DOMString widgetName, SsoCallDataSuccessCallback onsuccess, optional ErrorCallback ? onerror); DOMString getVersion( ); DOMString getLoginUid( ); SsoLoginState getLoginStatus(); void showCreateAccountView(SsoStringSuccessCallback onsuccess, optional ErrorCallback ? onerror); |
SsoCallDataSuccessCallback | void onsuccess(SsoCallData data); |
SsoStringSuccessCallback | void onsuccess(DOMString data); |
SsoSnsListSuccessCallback | void onsuccess(DOMString SNSList); |
SsoLoginState | |
SsoTermsAgreementState |
dictionary SsoCallData{
DOMString status;
};
The following values are supported
[NoInterfaceObject]interface SsoManagerObject {
readonly attribute SsoManager sso;
};
[NoInterfaceObject]interface SsoManager {
void showAccountView(DOMString widgetName, SsoCallDataSuccessCallback onsuccess, optional ErrorCallback ? onerror);
DOMString getVersion( );
DOMString getLoginUid();
SsoLoginState getLoginStatus();
void showCreateAccountView(SsoStringSuccessCallback onsuccess, optional ErrorCallback ? onerror);
};
showAccountView
void showAccountView(DOMString widgetName, SsoCallDataSuccessCallback onsuccess, optional ErrorCallback ? onerror);
Since : 2.3
Privilege level: Partner
Privilege: http://developer.samsung.com/privilege/sso.partner
Parameters:
Exceptions:
with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
with error type NotSupportedError, if this feature is not supported.
with error type InvalidValuesError, if any input parameter contains an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError, for any other error.
Code example:
var onsuccess = function(result) {
console.log('success : ' + JSON.stringify(result));
};
var onerror = function (error) {
console.log('error : ' + error);
};
webapis.sso.showAccountView("Facebook", onsuccess, onerror);
getVersion
DOMString getVersion( );
Since : 2.3
Privilege level: Partner
Privilege: http://developer.samsung.com/privilege/sso.partner
Return value:
DOMString VersionExceptions:
with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
with error type NotSupportedError, if this feature is not supported.
with error type InvalidValuesError, if any input parameter contains an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError, for any other error.
Code example:
var result = webapis.sso.getVersion();
getLoginUid
DOMString getLoginUid();
Since : 2.3
Privilege level: Partner
Privilege: http://developer.samsung.com/privilege/sso.partner
Return value:
DOMString UIDExceptions:
with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
with error type NotSupportedError, if this feature is not supported.
with error type InvalidValuesError, if any input parameter contains an invalid value.
with error type InvalidStateError, if the user is not signed in.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError, for any other error.
Code example:
var result = webapis.sso.getLoginUid();
getLoginStatus
SsoLoginState getLoginStatus();
Since : 2.3
Privilege level: Partner
Privilege: http://developer.samsung.com/privilege/sso.partner
Return value:
SsoLoginState Login StateExceptions:
with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
with error type NotSupportedError, if this feature is not supported.
with error type InvalidValuesError, if any input parameter contains an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError, for any other error.
Code example:
var result = webapis.sso.getLoginStatus();
showCreateAccountView
void showCreateAccountView(SsoStringSuccessCallback onsuccess, optional ErrorCallback ? onerror);
Since : 2.3
Privilege level: Partner
Privilege: http://developer.samsung.com/privilege/sso.partner
Parameters:
Exceptions:
with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
with error type NotSupportedError, if this feature is not supported.
with error type InvalidValuesError, if any input parameter contains an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError, for any other error.
Code example:
var onsuccess = function(result) {
console.log('success : ' + JSON.stringify(result));
};
var onerror = function (error) {
console.log('error : ' + error);
};
webapis.sso.showCreateAccountView(onsuccess, onerror);
[Callback = FunctionOnly, NoInterfaceObject]interface SsoCallDataSuccessCallback {
void onsuccess(SsoCallData data);
};
onsuccess
void onsuccess(SsoCallData data);
Parameters:
[Callback = FunctionOnly, NoInterfaceObject]interface SsoStringSuccessCallback { void onsuccess(DOMString data); };
onsuccess
void onsuccess(DOMString data);
Parameters:
[Callback = FunctionOnly, NoInterfaceObject]interface SsoStringSuccessCallback { void onsuccess(DOMString data); };
onsuccess
void onsuccess(DOMString SNSList);
Parameters:
[NoInterfaceObject]interface SsoLoginState {
const unsigned short SSO_NOT_LOGIN = 0;
const unsigned short SSO_LOGIN = 1;
};
[NoInterfaceObject]interface SsoLoginState {
const unsigned short SSO_NOT_LOGIN = 0;
const unsigned short SSO_LOGIN = 1;
};
module Sso {
dictionary SsoData{
boolean bLogin;
DOMString id;
DOMString authToken;
DOMString uid;
DOMString guid;
};
dictionary SsoCallData{
DOMString status;
};
[NoInterfaceObject]interface SsoManagerObject {
readonly attribute SsoManager sso;
};
[NoInterfaceObject]interface SsoManager {
void showAccountView(DOMString widgetName, SsoCallDataSuccessCallback onsuccess, optional ErrorCallback ? onerror);
DOMString getVersion( );
DOMString getLoginUid();
SsoLoginState getLoginStatus();
void showCreateAccountView(SsoStringSuccessCallback onsuccess, optional ErrorCallback ? onerror);
};
[Callback = FunctionOnly, NoInterfaceObject]interface SsoDataSuccessCallback {
void onsuccess(SsoData data);
};
[Callback = FunctionOnly, NoInterfaceObject]interface SsoCallDataSuccessCallback {
void onsuccess(SsoCallData data);
};
[Callback = FunctionOnly, NoInterfaceObject]interface SsoStringSuccessCallback {
void onsuccess(DOMString data);
};
[Callback = FunctionOnly, NoInterfaceObject]interface SsoSnsListSuccessCallback {
void onsuccess(DOMString SNSList);
};
[NoInterfaceObject]interface SsoLoginState {
const unsigned short SSO_NOT_LOGIN = 0;
const unsigned short SSO_LOGIN = 1;
};
[NoInterfaceObject]interface SsoTermsAgreementState {
const unsigned short SSO_NOT_AGREE = 0;
const unsigned short SSO_AGREE = 1;
};
};