【发布时间】:2020-09-10 21:51:12
【问题描述】:
如何获取 WebOS smarttv 上已安装应用程序的列表?一个具有应用程序 ID,我稍后会尝试使用应用程序管理器打开它们。
我使用的是带有 WebOS 4.7.2 的 2019 型号,并且我启用了开发模式,可以从 ide 等运行应用程序。
我尝试过使用the application manager:
webOS.service.request("luna://com.webos.service.applicationmanager", {
method: "listApps",
parameters: {},
onSuccess: function (res) {
console.log("List apps success. ", res);
},
onFailure: function (res) {
console.log("List apps fail. ", res);
},
});
{ errorCode: -1, errorText: "Denied method call "listApps" for category "/"", returnValue: false } 失败
如果我尝试使用dev/listApps,我会得到{ errorCode: -1, errorText: "Unknown method "listApps" for category "/dev"", returnValue: false },但请注意:
webOS.service.request("luna://com.webos.service.devmode", {
method: "setDevMode",
parameters: {
enabled: true
},
onSuccess: function (res) {
console.log("Devmode success. ", res);
webOS.service.request("luna://com.webos.service.devmode", {
method: "getDevMode",
parameters: {},
onSuccess: function (res) {
console.log("get devmode success. ", res);
},
onFailure: function (res) {
console.log("get devmode fail. ", res);
},
});
},
onFailure: function (res) {
console.log("Devmode fail. ", res);
},
给我Service does not exist: com.webos.service.devmode
为了更好地衡量,我还尝试使用 CLI,using examples from the webos site。
ares-install --device webOS_TV --listfull 导致列出这个应用程序:
id:com.domain.app, defaultWindowType:card, CPApp:false, systemApp:false, version:0.0.1, vendor:My Company, hasPromotion:false, tileSize:normal, icons:, largeIcon:largeIcon.png, lockable:true, transparent:false, icon:icon.png, checkUpdateOnLaunch:true, spinnerOnLaunch:true, handlesRelaunch:false, unmovable:false, inspectable:true, inAppSetting:false, privilegedJail:false, noSplashOnLaunch:false, title:CommandsTest, deeplinkingParams:, trustLevel:default, visible:true, folderPath:/media/developer/apps/usr/palm/applications/com.domain.app, accessibility:[object Object], main:index.html, removable:true, type:web, disableBackHistoryAPI:false, installTime:0
作为参考,我知道这是可能的,因为在这个问题中:Get icon of installed apps on WebOS TV LG 有人提到获取应用程序列表只是为了获取他们的图标,并且它以 youtube 应用程序作为其中一项的示例。
我看到了this question,但答案中使用的库已经很老了,我无法运行它(我在运行时也需要这个列表)。其中一些应用程序 ID 用于我的测试,用于使用应用程序管理器打开它们。
谢谢!
【问题讨论】:
标签: webos