@@ -62,6 +62,7 @@ HotelTV.hal = (function() {
|
||||
|
||||
const g_nativApps_info = {
|
||||
'preapp': null,
|
||||
'generalapp': null,
|
||||
};
|
||||
|
||||
|
||||
@@ -1520,30 +1521,104 @@ HotelTV.hal = (function() {
|
||||
}
|
||||
},
|
||||
|
||||
PreAppGetInfo: function(_en_show_msg) {
|
||||
// if (g_nativApps_info.preapp == null) {
|
||||
// hcap.preloadedApplication.getPreloadedApplicationList({
|
||||
// "onSuccess": function(s) {
|
||||
// if (_en_show_msg == true) {
|
||||
// console.log("onSuccess : list length = " + s.list.length);
|
||||
// for (var i = 0; i < s.list.length; i++) {
|
||||
// console.log(
|
||||
// "list[" + i + "].id = " + s.list[i].id +
|
||||
// "list[" + i + "].title = " + s.list[i].title +
|
||||
// "list[" + i + "].iconFilePath = " + s.list[i].iconFilePath
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// if (s.result == true) {
|
||||
// g_nativApps_info.preapp = s.list;
|
||||
// }
|
||||
// },
|
||||
// "onFailure": function(f) {
|
||||
// console.log("onFailure : errorMessage = " + f.errorMessage);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
AppGetInfo: function(_en_show_msg) {
|
||||
return new Promise((resolve, reject) => {
|
||||
hcap.application.getApplicationList({
|
||||
"onSuccess": function(s) {
|
||||
if (_en_show_msg == true) {
|
||||
console.log("onSuccess : list length = " + s.list.length);
|
||||
for (var i = 0; i < s.list.length; i++) {
|
||||
console.log(
|
||||
"list[" + i + "].appId = " + s.list[i].appId +
|
||||
"list[" + i + "].title = " + s.list[i].title +
|
||||
"list[" + i + "].version = " + s.list[i].version +
|
||||
"list[" + i + "].valid = " + s.list[i].valid +
|
||||
"list[" + i + "].iconPath = " + s.list[i].iconPath
|
||||
);
|
||||
}
|
||||
}
|
||||
if (s.result == true) {
|
||||
g_nativApps_info.generalapp = s.list;
|
||||
resolve({ "error": 0, "applist": g_nativApps_info.generalapp });
|
||||
}
|
||||
},
|
||||
"onFailure": function(f) {
|
||||
console.log("onFailure : errorMessage = " + f.errorMessage);
|
||||
resolve({ "error": -1, "applist": null });
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
AppInstall: function(list_app_id, _en_show_msg) {
|
||||
return new Promise((resolve, reject) => {
|
||||
hcap.application.installApplications({
|
||||
"AppList" : list_app_id,
|
||||
"onSuccess": function(s) {
|
||||
if (_en_show_msg == true) {
|
||||
console.log("onSuccess");
|
||||
}
|
||||
resolve({ "error": 0, "msg": "success" });
|
||||
},
|
||||
"onFailure": function(f) {
|
||||
console.log("onFailure : errorMessage = " + f.errorMessage);
|
||||
resolve({ "error": -1, "msg": f.errorMessage });
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
LaunchApp: function(_name, _param) {
|
||||
if (g_nativApps_info.generalapp != null) {
|
||||
if (_name == "coupangplay") {
|
||||
for (const [key, item] of Object.entries(g_nativApps_info.generalapp)) {
|
||||
if (item.title == 'Coupang Play') {
|
||||
hcap.application.launchApplication({
|
||||
"id" : item.appId,
|
||||
"onSuccess" : function() {
|
||||
console.info("onSuccess");
|
||||
},
|
||||
"onFailure" : function(f) {
|
||||
console.info("onFailure : errorMessage = " + f.errorMessage);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if (_name == "wavve") {
|
||||
for (const [key, item] of Object.entries(g_nativApps_info.generalapp)) {
|
||||
if (item.title == 'wavve') {
|
||||
hcap.application.launchApplication({
|
||||
"id" : item.appId,
|
||||
"onSuccess" : function() {
|
||||
console.info("onSuccess");
|
||||
},
|
||||
"onFailure" : function(f) {
|
||||
console.info("onFailure : errorMessage = " + f.errorMessage);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if (_name == "tving") {
|
||||
for (const [key, item] of Object.entries(g_nativApps_info.generalapp)) {
|
||||
if (item.title == 'TVING') {
|
||||
hcap.application.launchApplication({
|
||||
"id" : item.appId,
|
||||
"onSuccess" : function() {
|
||||
console.info("onSuccess");
|
||||
},
|
||||
"onFailure" : function(f) {
|
||||
console.info("onFailure : errorMessage = " + f.errorMessage);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log("General Application doesn't exist");
|
||||
}
|
||||
},
|
||||
|
||||
PreAppGetInfo: function(_en_show_msg) {
|
||||
return new Promise((resolve, reject) => {
|
||||
hcap.preloadedApplication.getPreloadedApplicationList({
|
||||
"onSuccess": function(s) {
|
||||
|
||||
Reference in New Issue
Block a user