-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
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.
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
Metadata
Metadata
Assignees
Labels
No labels