ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Google Chrome Push Notification in ASP.Net<p>Hi <a class="username" rel="basit0079"> basit0079</a>,</p> <p>Refer below link.</p> <p><a href="https://stackoverflow.com/questions/37410818/google-chrome-push-notification">https://stackoverflow.com/questions/37410818/google-chrome-push-notification</a></p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/594139/Google-Chrome-Push-Notification-in-ASPNet/https://www.aspforums.net:443/Threads/594139/Google-Chrome-Push-Notification-in-ASPNet/Thu, 21 Dec 2017 03:36:38 GMTGoogle Chrome Push Notification in ASP.Net<p>Many Thanks.</p> <p>&nbsp;my service-worker.js below variable are hard coded,</p> <p>how to define such variable where i can send with above .net code and showing atleast body var message. Whenever i'm sending push up notification with above .net code its showing same body becoz its hard coded.</p> <pre class="brush: js"> var title = &#39;Pushup Notification&#39;; var body = &#39;Test&#39;; var icon = &#39;images/icon.png&#39;; var badge = &#39;images/badge.png&#39; var tag = &#39;simple-push-demo-notification-tag&#39;;</pre> <p>Thanks</p> <p>Basit.</p>https://www.aspforums.net:443/Threads/594139/Google-Chrome-Push-Notification-in-ASPNet/https://www.aspforums.net:443/Threads/594139/Google-Chrome-Push-Notification-in-ASPNet/Fri, 22 Dec 2017 07:18:45 GMTGoogle Chrome Push Notification in ASP.Net<p>Hi,</p> <p>I changed my service-worker.js.</p> <p>&nbsp;Below is my service-worker.js file.</p> <pre class="brush: js">self.addEventListener(&#39;push&#39;, function (event) { var data = {}; var icon = &#39;images/icon.png&#39;; if (event.notification) { console.log(&#39;Received a push message&#39;); data = event.notification.json(); event.waitUntil( self.registration.showNotification(data.title, { body: data.body, icon: icon, tag: data.tag }) ); } else { console.log(&#39;No push data received&#39;); console.log(event); var title = &#39;Yay a message!&#39;; var body = &#39;We have received a push message.&#39;; var icon = &#39;images/icon.png&#39;; var tag = &#39;simple-push-demo-notification-tag&#39;; event.waitUntil( self.registration.showNotification(title, { body: body, icon: icon, tag: tag }) ); } });</pre> <p>But how to pass&nbsp;</p> <pre class="brush: js">body: data.body //parameter to above .net code</pre>https://www.aspforums.net:443/Threads/594139/Google-Chrome-Push-Notification-in-ASPNet/https://www.aspforums.net:443/Threads/594139/Google-Chrome-Push-Notification-in-ASPNet/Sat, 23 Dec 2017 06:49:29 GMTGoogle Chrome Push Notification in ASP.Net<p>Hi <a class="username" rel="basit0079"> basit0079</a>,</p> <p>What is the problem with this code. Are you getting any error?</p>https://www.aspforums.net:443/Threads/594139/Google-Chrome-Push-Notification-in-ASPNet/https://www.aspforums.net:443/Threads/594139/Google-Chrome-Push-Notification-in-ASPNet/Tue, 26 Dec 2017 04:46:48 GMT