[DeviceHome] Send push registration id 57/268857/7
authorDongHyun Song <dh81.song@samsung.com>
Tue, 4 Jan 2022 03:05:15 +0000 (12:05 +0900)
committerSangYong Park <sy302.park@samsung.com>
Fri, 11 Feb 2022 01:52:17 +0000 (01:52 +0000)
Send push registration id with device info, which is given from
wrt-service-broker when push connection is established.

Change-Id: I8858983bf4f7f85072e1bd5dfa170d1f419d2f3c
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
device_home/service/initializer/service.js

index 1d782a0..d3db0ab 100755 (executable)
@@ -22,10 +22,23 @@ class Initializer {
         console.log(`${TAG} failed to get device_ip`);
         return;
       }
+      let req_id = '';
+      let req_appcontrol = tizen.application.getCurrentApplication().getRequestedAppControl();
+      if (req_appcontrol) {
+        let data = req_appcontrol.appControl.data;
+        data.forEach((bundle) => {
+          if (bundle.key === 'push_reg_id') {
+            req_id = bundle.value[0];
+            return false;
+          }
+        })
+      }
+
       const device = {
         device_ip: this.device_ip,
         device_name: this.device_name,
-        login_id: this.login_id
+        login_id: this.login_id,
+        req_id
       };
       console.log(`${TAG} device :`, device);
       const data = JSON.stringify(device);