The Ignite Realtime Community is pleased to announce the 1.0.0 release of the Push Server plugin for Openfire. This plugin is developed by the company Busoft Teknoloji A.Ş. It is inspired by Conversations Push Proxy and developed for Openfire.
Your instance of Openfire should automatically display the availability of the new plugin in the next few hours. Alternatively, you can download the the plugin directly from the Push Server plugin archive page.
Due to the restrictions in push services (FCM or APNS), only the developer can create push notifications for their apps. For this reason a user’s server wouldn’t be able to wake up a user’s device directly but has to proxy that wake up signal through the infrastructure of the app developer.
Push Server Plugin is an XEP-0357: Push Notifications app server that relays push messages between the user’s server and FCM (Firebase Cloud Messaging) or APNS (Apple Push Notification Service).
Here is a quick description of how this relationship is set up.
XMPP Client sends to the app server
- Device Token
- Device Id
App Server generates
- Node Id
- Secret
App Server stores
- Device Token
- Device Id
- Node
- Secret
App Server returns to XMPP Client
- Node Id
XMPP Client sends to the user's server
- Node ID
- The jid of the app server (push.example.com)
When a push is required the user’s server will send the node id to the app server. The user’s server can also add additonal information like number of messages pending, the sender jid of the last message and even the body of the last message.
Unfortunately, it is only a typo. You can use the one with version number 1.0.0 released at Sep 2, 2021 in the plugin’s archive page. It is also the same one published in the Plugin’s Admin Console.
I’m trying to make push notification on my openfire server as the way I mentioned in the last question.
I installed the both of Push Notification plugin and Push Server plugin to my openfire host.
So the XMPP server and push server have a same domain name commonly.
I registered my client successfully to the push server and then sent a message stanza from an other client when that client is away.
But the away client couldn’t get a push notification.
Then I found following logs from my openfire server.
it seems that the “Push Notification” plugin cannot route the message to the “Push Server” of the same host.
Can you guess what I’ve missed?
2022.10.22 13:44:55 e[30mTRACEe[m [socket_c2s-thread-4]: org.igniterealtime.openfire.plugins.pushnotification.PushInterceptor - Message stored to offline storage. Try to send push notification.
2022.10.22 13:44:55 e[30mTRACEe[m [socket_c2s-thread-4]: org.igniterealtime.openfire.plugins.pushnotification.PushServiceManager - User 'apptest' has 1 push notification services configured.
2022.10.22 13:44:55 e[30mTRACEe[m [socket_c2s-thread-4]: org.igniterealtime.openfire.plugins.pushnotification.PushInterceptor - For user 'apptest', 1 push service(s) are configured.
2022.10.22 13:44:55 e[30mTRACEe[m [socket_c2s-thread-4]: org.igniterealtime.openfire.plugins.pushnotification.PushInterceptor - For user 'apptest', found service 'otherhome.au'
2022.10.22 13:44:55 e[30mTRACEe[m [socket_c2s-thread-4]: org.igniterealtime.openfire.plugins.pushnotification.PushInterceptor - For user 'apptest', found node 'register-push-apns' of service 'otherhome.au'
2022.10.22 13:44:55 e[30mTRACEe[m [socket_c2s-thread-4]: org.igniterealtime.openfire.plugins.pushnotification.PushInterceptor - For user 'apptest', Routing push notification to 'otherhome.au'
2022.10.22 13:44:55 e[1;31mERRORe[m [socket_c2s-thread-4]: org.jivesoftware.openfire.spi.RoutingTableImpl - Primary packet routing failed**
**org.jivesoftware.openfire.PacketException: Cannot route packet of type IQ or Presence to bare JID: <iq type="set" id="459-4920" to="otherhome.au" from="myopenfire.com"><pubsub xmlns="http://jabber.org/protocol/pubsub"><publish node="register-push-apns"><item><notification xmlns="urn:xmpp:push:0"><x xmlns="jabber:x:data" type="form"><field var="FORM_TYPE" type="hidden"><value>urn:xmpp:push:summary</value></field><field var="message-count" type="text-single"><value>1</value></field><field var="last-message-sender" type="text-single"><value>kei@myopenfire.com/gajim.MOTKEHWO</value></field><field var="last-message-body" type="text-single"><value>hi</value></field></x></notification></item></publish></pubsub></iq>
at org.jivesoftware.openfire.spi.RoutingTableImpl.routeToLocalDomain(RoutingTableImpl.java:419) ~[xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.java:350) [xmppserver-4.7.3.jar:4.7.3]
at org.igniterealtime.openfire.plugins.pushnotification.PushInterceptor.tryPushNotification(PushInterceptor.java:226) [pushnotification-0.9.2-SNAPSHOT.jar!/:?]
at org.igniterealtime.openfire.plugins.pushnotification.PushInterceptor.messageStored(PushInterceptor.java:265) [pushnotification-0.9.2-SNAPSHOT.jar!/:?]
at org.jivesoftware.openfire.OfflineMessageStrategy.store(OfflineMessageStrategy.java:201) [xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.OfflineMessageStrategy.storeOffline(OfflineMessageStrategy.java:145) [xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.MessageRouter.routingFailed(MessageRouter.java:268) [xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.java:378) [xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.MessageRouter.route(MessageRouter.java:134) [xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:79) [xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.net.StanzaHandler.processMessage(StanzaHandler.java:411) [xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.net.ClientStanzaHandler.processMessage(ClientStanzaHandler.java:109) [xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:235) [xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:198) [xmppserver-4.7.3.jar:4.7.3]
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:183) [xmppserver-4.7.3.jar:4.7.3]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:1015) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:122) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:413) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:257) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:106) [mina-core-2.1.3.jar:?]
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:89) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:766) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:758) [mina-core-2.1.3.jar:?]
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:697) [mina-core-2.1.3.jar:?]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_342]
2022.10.22 13:44:55 e[36mDEBUGe[m [socket_c2s-thread-4]: org.jivesoftware.openfire.spi.RoutingTableImpl - Failed to route packet to JID: myopenfire.com packet: <iq type="set" id="459-4920" to="myopenfire.com" from="myopenfire.com"><pubsub xmlns="http://jabber.org/protocol/pubsub"><publish node="register-push-apns"><item><notification xmlns="urn:xmpp:push:0"><x xmlns="jabber:x:data" type="form"><field var="FORM_TYPE" type="hidden"><value>urn:xmpp:push:summary</value></field><field var="message-count" type="text-single"><value>1</value></field><field var="last-message-sender" type="text-single"><value>kei@myopenfire.com/gajim.MOTKEHWO</value></field><field var="last-message-body" type="text-single"><value>hi</value></field></x></notification></item></publish></pubsub></iq>
2022.10.22 13:44:55 e[36mDEBUGe[m [socket_c2s-thread-4]: org.jivesoftware.openfire.IQRouter - IQ sent to unreachable address 'myopenfire.com': <iq type="set" id="459-4920" to="myopenfire.com" from="myopenfire.com"><pubsub xmlns="http://jabber.org/protocol/pubsub"><publish node="register-push-apns"><item><notification xmlns="urn:xmpp:push:0"><x xmlns="jabber:x:data" type="form"><field var="FORM_TYPE" type="hidden"><value>urn:xmpp:push:summary</value></field><field var="message-count" type="text-single"><value>1</value></field><field var="last-message-sender" type="text-single"><value>kei@myopenfire.com/gajim.MOTKEHWO</value></field><field var="last-message-body" type="text-single"><value>hi</value></field></x></notification></item></publish></pubsub></iq>
2022.10.22 13:44:55 e[36mDEBUGe[m [socket_c2s-thread-4]: org.igniterealtime.openfire.plugins.pushnotification.PushInterceptor - Delivered a notification for user 'apptest' to node 'register-push-apns' on service 'myopenfire.com'.
If yes, now since I’m trying to set everything in a single node, finally do I need to add a virtual host of “push.example.com” for that node to work as taking the both roles of XMPP server and XMPP push server?
Thank you, Hamzaozturk.
As you adviced, I just changed the ‘to’ part of the registration IQ as “push.example.com”.
And above problem was solved and I passed that.
However, I faced another error following.
[1;31mERRORe[m [socket_c2s-thread-3]: org.igniterealtime.openfire.plugins.pushserver.PushServerIQHandler - 'publish-options' element should be set.
Hi, Hamzaoztruk.
I got the meaning of ‘secret’.
You already explained about it at the ‘readme’ of the Push Server Plugin and I just have missed it in there.
I’ll try my mobile app to get push notifications after ‘enable’ push notificatoin with ‘secret’ from the result of the registration.