I'm creating an iOS app that relies heavily on user interaction with notifications. When the user interacts with a notification, themselves and their followers will be notified immediately.
For this, I've decided to use Firebase Cloud Messaging, since I'm already using other Firebase services.
My app server is written in TypeScript using Node.js, and node-xmpp-server. According to the documentation, there is no FCM Java SDK, so Node.js was the logical choice.
When my server is run, it creates a Client
and listens for incoming stanzas from FCM. Something similar to this:
var Client = require('node-xmpp-client')
var client = new Client({
jid: 'user@example.com',
password: 'password'
})
client.on('online', function() {
console.log('online')
})
client.on('stanza', function(stanza) {
console.log('Incoming stanza: ', stanza.toString())
})
For the entire server, there is only one Client
that listens for all incoming stanzas form FCM.
I have so many questions that I wasn't able to find in the Firebase documentation.
- Will simultaneous stanzas come in to my server? Or will Firebase ensure only one is sent and handled at a time?
- If simultaneous stanzas come in, what happens? Will some get lost?
- Do I need to restructure my server to handle simultaneous stanzas? If so, how do I go about doing that when all I can do with FCM is listen for stanzas?
Thanks!