So what I understand about how the flow will proceed is:
XMPP Server generates notification. The Push Notification plugin will handle that
The generated notification will be passed on to my preferred Push Service (e.g. Firebase CM). This step will be handled by the Openfire Push Server plugin.
The end user (assuming the client is configured rightly) will get the notification.
The doubt: When will the server generate a notification, for which scenarios? What data (xml stanza I assume) will it have? These things are ambiguous to me right now.
Second thing, not completely Openfire related, but If you have worked with Firebase CM to push notifications, can you please share the details how you did it. The help would be immensely appreciated.
PushNotification plugin doesn’t have direct integration with FCM as the plugin provides implementation of XEP-0357.
If you have your own server side integration with FCM then by using CallbackOnOffline plugin, you can get http call from Openfire whenever there is an offline message in 1-1 chat. Plugin configuration details are mentioned in it’s README file.
If you have your own server side integration with FCM then by using CallbackOnOffline plugin, you can get http call from Openfire whenever there is an offline message in 1-1 chat. Plugin configuration details are mentioned in it’s README file.
Well isn’t that what the Push Notification plugin for? Let us get on the same page, what does the Push Notification do?
The process of triggering a push notification is complex, because of the different administrative entities that are involved. It goes like this:
The Push Notification plugin cannot directly instruct FCM to generate a push notification, as FCM wants to make sure that this is tightly controlled (with regards to authentication an authorization). If they wouldn’t do that, then everyone and their uncle would be able to spam your phone with push notifications.
It’s the author of a particular client that wants its client to be capable to receive push notifications. This author is the one that has a account with FCM.
The client author is typically not the same entity as the administrator of the XMPP server. There is thus a need for a ‘proxy’ entity.
This is where the Push Server comes in. This server is ran/maintained by the client author. Its purpose is to handle push notifications for users of their client.
When an end-user’s client connects to Openfire, it registers that any push notifications are to be forwarded to the push notification server that is maintained by the client author. Whenever an event occurs that Openfire deems worthy of sending a push notification for, it will look up the registered push notification server for the account, and tell it to generate a push notification for a client. This push notification server will then interact with FCM (using the client author’s credentials) to have the actual push notification be delivered to the client of the end-user
The Openfire Push Notification plugin will trigger push notifications (based on message stanzas being received) but it is not programmable or configurable.
If you’d like to generate push notifications based on custom data or events, you may want to write your own plugin to replace the Push Notification plugin (or, alternatively, if what you’re writing would be of benefit to the larger community, you could consider creating a pull request to improve the existing plugin).
Openfire Push Notification plugin will trigger push notifications (based on message stanzas being received) but it is not programmable or configurable.
So how are we supposed to use it exactly, its still unclear.
And the Push Server Plugin, it has configurations for iOS and Android.
So wouldn’t it work if I have both plugins installed. ‘Push Notification’ plugin generates notification, and ‘Push Server’ plugin will send them. (I do not want custom functionality for generating notifications)
The push notification plugin installed on your instance of Openfire.
The author of the client that you’re using needs to run a push server (which could be Openfire’s Push Notification server, but could also be any of the other servers that are available.
The second bit can, but does not need to be installed at your Openfire server. The client software will register for each user what the address of the to-be-used push notification server is. Your instance of Openfire will then use server-to-server connectivity (“federation”) to contact the server, if it happens to be installed elsewhere than in your own Openfire server.