From 33baa98aefc7b5dffbb9f9ca93e672d8a618c88f Mon Sep 17 00:00:00 2001 From: DongHyun Song Date: Tue, 4 Jan 2022 12:05:15 +0900 Subject: [PATCH] [DeviceHome] Send push registration id 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 --- device_home/service/initializer/service.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/device_home/service/initializer/service.js b/device_home/service/initializer/service.js index 1d782a0..d3db0ab 100755 --- a/device_home/service/initializer/service.js +++ b/device_home/service/initializer/service.js @@ -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); -- 2.7.4