[Service] Support simple notification popup 24/248024/5
authorDongHyun Song <dh81.song@samsung.com>
Thu, 26 Nov 2020 04:01:47 +0000 (13:01 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Mon, 14 Dec 2020 08:44:35 +0000 (17:44 +0900)
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 <dh81.song@samsung.com>
wrt_app/service/device_api_router.ts

index 18ec305e64b0ee3e85a0e5bedf9d4e66a83cbb04..e188d99ee2925f56228adf8ebfd37abaae3838b1 100644 (file)
@@ -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();