Launching AppStore from Samsung Tizen TV App

Viewed 83

I'm trying to implement a button in Javascript based Tizen TV application. Upon clicking the button it should open App Store page of another application.

I'm referring to these documents: https://developer.tizen.org/sites/default/files/documentation/tizen2.3_deep_linking_guide_v1.0.pdf https://developer.tizen.org/ko/community/tip-tech/linking-your-application?langredirect=1 Deeplinking to youtube content on Samsung TV (Tizen)

I have added the following privileges in config.xml

  <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
  <tizen:privilege name="http://tizen.org/privilege/appmanager.launch"/>

window.tizen is returning the following object

{"BundleValueType":{"STRING":"STRING","STRING_ARRAY":"STRING_ARRAY","BYTES":"BYTES","BYTES_ARRAY":"BYTES_ARRAY"},"cordova":{"file":{},"globalization":{}},"tvinputdevice":{},"systeminfo":{},"account":{},"alarm":{"PERIOD_MINUTE":60,"PERIOD_HOUR":3600,"PERIOD_DAY":86400,"PERIOD_WEEK":604800},"application":{},"archive":{},"filesystem":{"maxNameLength":255,"maxPathLength":4096},"content":{},"datacontrol":{},"download":{},"exif":{},"iotcon":{"deviceName":""},"keymanager":{},"mediacontroller":{},"mediakey":{},"messageport":{},"package":{},"push":{},"time":{},"tvaudiocontrol":{},"tvchannel":{},"tvdisplaycontrol":{},"tvinfo":{},"tvwindow":{},"voicecontrol":{},"websetting":{}}

Here window.tizen.application is an empty object

But we need to get window.tizen.application.launch OR window.tizen.applciation.launchAppControl to implement this functionality (as per above documents)

Does anyone have any idea why it's not available?

1 Answers

Please refer the sample function.

Pre-con: You have to know the App ID of target app (get from Seller Office).

function launchSmartHub() {

    var appName = 'com.samsung.tv.store';

    var subMenu = 'detail';

    var widgetID = '3202xxxxxx'; //Target app id - 13 digits

    var callerID = '3202xxxxxx'; //Your current app id - 13 digit

    var appControl = new window.tizen.ApplicationControl('http://tizen.org/appcontrol/operation/view', null, null, null, [

        new window.tizen.ApplicationControlData("Sub_Menu", [subMenu]),

        new window.tizen.ApplicationControlData("widget_id", [widgetID]),

        new window.tizen.ApplicationControlData("caller_id", [callerID])

    ]);


    window.tizen.application.launchAppControl(appControl, appName, 
    function onLaunchSuccess() {    
        console.error("Open App Store successfully");    
    }, function onLaunchError(e) {    
        console.error(e, "Error on AppControl Launch");    
    }, {    
        onsuccess: function() {    
            console.error("Reply Here");    
        }    
    });

/*

URL to app store is different per each year;

•2016 org.volt.apps

•2017 org.volt.apps

•From 2018 com.samsung.tv.store

*/

Related