Firebase Queue and Push Notifications

1,350 views
Skip to first unread message

Maitham Dib

unread,
Feb 22, 2017, 10:41:57 AM2/22/17
to Firebase Google Group
Hi

I've set up push notifications on my ionic 2 app, and require some help regarding queuing the push notifications.  My database is held in firebase and I am using One signal for push notifications.  If a new message gets sent a push notification request is created at fb.database.ref('notificationRequest'). I have a separate node instance running on Heroku which listens in to child_add events under this tree. Now the problem I'm having is that if a user logs out of the app, I can no longer send him Push Notifications, and unless the server restarts a push notification won't be sent to the user. 

How can I utilise firebase queue to keep trying to push notifications to the user until it is received? 

Or how do I use firebase queue to ensure that the user always gets the push notification?




Kato Richardson

unread,
Feb 23, 2017, 7:01:23 PM2/23/17
to Firebase Google Group
Maitham,

What exactly do you mean here? It looks to me like OneSignal can deliver push notifications when an app is closed. So this sounds like an application bug.

Also note that Firebase offers a free, integrated solution, Cloud Messaging.

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/de13e5ed-9679-4bea-911f-2285f301507f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Maitham Dib

unread,
Feb 24, 2017, 12:58:11 AM2/24/17
to Firebase Google Group
Hi

I've figured out how to do this, however if I have groups I need to send notifications to users in that group bar the one who sent the message. However how do I manage the response in such a way that if one push notification fails the whole queue doesnt get rejected but just the queue for the user who it failed for. 


This is the code I currently have : 

 var fanout_pushOptions = {
       
'specId': 'fanout_pushNotifications',
       
'numWorkers': 5,
   
};


   
var fanoutPushNotifications = new Queue(queueRef, fanout_pushOptions, function (data, progress, resolve, reject) {


        data
.membersToNotify.forEach(memberID => {


            alertUtil
.sendMessageNotification(data.groupName, data.senderName, data.message, memberID)
       
})
        resolve
()
   
})

Jacob Wenger

unread,
Feb 24, 2017, 2:35:23 PM2/24/17
to fireba...@googlegroups.com
Just an FYI that we recently introduced an API to send FCM messages within the Firebase Admin Node.js SDK. That should fit in nicely with Firebase Queue and make the interactions with FCM simpler.

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages