You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I've been trying to pass a JSON object instead of a String.
Maybe there's something i don't understand in the flow.
messages.json { "messages": [ { "title": "You got a new message!", "text": "Go check your WebMail.", "url": "https://ww.gmail.com" }, { "title": "Live Session", "text": "Your prof will be live on Monday, January 22 at 4pm", "url": "http://www.google.com" } ] }
index.js function send(){ if (client) { //console.log( messages[currentMessage]) client.send(channel, messages[currentMessage]); currentMessage++; }; }
When i pass an object instead of a string, i don't get any console from the theClient.subscribeWithNotifications function.
Hi,
I've been trying to pass a JSON object instead of a String.
Maybe there's something i don't understand in the flow.
messages.json
{ "messages": [ { "title": "You got a new message!", "text": "Go check your WebMail.", "url": "https://ww.gmail.com" }, { "title": "Live Session", "text": "Your prof will be live on Monday, January 22 at 4pm", "url": "http://www.google.com" } ] }
index.js
function send(){ if (client) { //console.log( messages[currentMessage]) client.send(channel, messages[currentMessage]); currentMessage++; }; }
service-worker.js
const notificationTitle = msg.title; const notificationOptions = { body: msg.text, icon: 'img/logo.jpg', data: { click_url: msg.url }, tag: Date.now() };
Any idea why?
Thanks in advance
The text was updated successfully, but these errors were encountered: