From 24e9d1ea30092f2b0ee938b279108e71edcb5239 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 24 May 2017 11:27:40 +0200 Subject: server: Replace notifs if from same room --- firebase-io/firebase-io.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'firebase-io') diff --git a/firebase-io/firebase-io.js b/firebase-io/firebase-io.js index 8a94076..bfcca0f 100755 --- a/firebase-io/firebase-io.js +++ b/firebase-io/firebase-io.js @@ -71,11 +71,13 @@ function processMessage(type,fields){ switch(type){ case "message": const user=fields.get("user"); + const room=fields.get("room"); const token=fields.get("token"); const payload={ notification: { - title: user+" ("+fields.get("room")+")", + title: user+" ("+room+")", body: fields.get("message"), + tag: room, } }; firebase.messaging().sendToDevice(token,payload) -- cgit v1.2.3-70-g09d2