From: DongHyun Song Date: Thu, 26 Nov 2020 04:01:47 +0000 (+0900) Subject: [Service] Support simple notification popup X-Git-Tag: submit/tizen_6.0/20201222.052907~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f25f94b6fa9d38a10ac26494a8e64f443a2d589;p=platform%2Fframework%2Fweb%2Fwrtjs.git [Service] Support simple notification popup User apps can use this notification posting API by calling webapis.postPlainNotification() - title: string, mandatory - message: string, mandatory - timeout: number, optional (10s default) Actually, this feature is alternative simple solution to show notification popup of tizen.UserNotification webapi. Global notification webapis is not included in TV platform. Related patch: https://review.tizen.org/gerrit/248025/ Change-Id: Ibf51f707be4b1edf3fc50dd94041df38cbdae168 Signed-off-by: DongHyun Song --- diff --git a/wrt_app/service/device_api_router.ts b/wrt_app/service/device_api_router.ts index 18ec305e..e188d99e 100644 --- a/wrt_app/service/device_api_router.ts +++ b/wrt_app/service/device_api_router.ts @@ -57,11 +57,15 @@ export class DeviceAPIRouter { global.webapis.getServiceId = () => { return this.serviceId; } + 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 }, getPermissions: { writable: false, enumerable: true }, getServiceId: { writable: false, enumerable: true }, + showPlainNotification: { writable: false, enumerable: true }, }); this.initEdgeWebapis(); this.initMDEWebapis();