}
initWebapis() {
- global.webapis = global.webapis ?? {};
+ let app_info = global.tizen.application.getAppInfo(this.serviceId);
+ if (app_info) {
+ this.packageId = app_info.packageId;
+ }
+ global.webapis = global.webapis ?? {};
global.webapis.getCallerAppId = () => {
return this.callerAppId;
}
global.webapis.getServiceId = () => {
return this.serviceId;
}
- let app_info = global.tizen.application.getAppInfo(this.serviceId);
- if (app_info) {
- this.packageId = app_info.packageId;
- }
global.webapis.getPackageId = () => {
return this.packageId;
}
+ global.webapis.postPlainNotification = (title: string, message: string, timeout?: number) => {
+ return wrt.postPlainNotification(title, message, timeout ?? 10);
+ }
+ Object.defineProperties(global.webapis, {
+ getCallerAppId: { writable: false, enumerable: true },
+ getPackageId: { writable: false, enumerable: true },
+ getServiceId: { writable: false, enumerable: true },
+ postPlainNotification: { writable: false, enumerable: true },
+ });
this.initProductWebapis();
}