module: new Module,
require: require,
tizen: global.tizen,
+ webapis: wrt.tv ? global.webapis : global.webapis = {},
};
sandbox[id].module.exports.onStop = () => {
callFunctionInContext('module.exports.onExit', id);
};
- let service_id = id.split(':')[0];
- sandbox[id].webapis = wrt.tv ? global.webapis : {};
+ let ids = id.split(':');
+ let caller_app_id = ids[1] ?? '';
+ sandbox[id].webapis.getCallerAppId = () => {
+ return caller_app_id;
+ }
+ let service_id = ids[0];
sandbox[id].webapis.getServiceId = () => {
return service_id;
}
let app_info = global.tizen.application.getAppInfo(service_id);
if (app_info)
return app_info.packageId;
- return '';
+ return ids[0].split('.')[0];
}
if (service_type !== 'UI') {