From: DongHyun Song Date: Tue, 4 Jan 2022 03:05:15 +0000 (+0900) Subject: [DeviceHome] Send push registration id X-Git-Tag: submit/tizen/20220214.160016~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33baa98aefc7b5dffbb9f9ca93e672d8a618c88f;p=platform%2Fframework%2Fweb%2Fwrtjs.git [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 --- diff --git a/device_home/service/initializer/service.js b/device_home/service/initializer/service.js index 1d782a0c..d3db0ab8 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);