How To: Push Server Plugin

How to use the Push Server plugin?

I have also installed ‘Push Notification’ plugin.


Now in the above image, we have two inputs, the Firebase Project ID and Service Account Key. I have set both things. Now I just have to add firebase to my project right? Is there any other thing to be done?

You’ll typically run the Push Server plugin when you’re creating your own IM client.

The implementation of your client should make sure that whenever a user enables push notifications, the user’s server (which might be a different server than your Openfire server) uses your Push Server (the client should reference this service by its JID, eg push.yourdomain.org).

The protocols that govern all this are defined in XEP-0357: Push Notifications

Okay

(the client should reference this service by its JID, eg push.yourdomain.org).
The protocols that govern all this are defined in XEP-0357: Push Notifications

Okay. I have both plugins configured.


First thing (refer 4.1 Account Owner Service Discovery of XEP-357)

Input:

<iq  to='rushiclient@rushiatunikwork'
    id='x13'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>

Output:

<iq to="rushiclient3@rushiatunikwork/RushiAtUnikwork" id="x13" from="rushiclient@rushiatunikwork" type="result">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="account" type="registered"/>
<identity category="pubsub" type="pep"/>
...
<feature var="urn:xmpp:push:0"/>
...
</query>
</iq>

So, it does return a <feature var="urn:xmpp:push:0"/>, which tells my server supports publishing push notifications


Second thing (refer 4.2 Push Service Discovery)

Input:

<iq to='push.rushiatunikwork'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>

Output:

<iq to="rushiclient3@rushiatunikwork/RushiAtUnikwork" from="push.rushiatunikwork" type="error">
<error code="400" type="modify">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>

Which returns an error, which means I am not sending the request correctly. Where is the error?


I am using PSI+ to send IQs and get XML results. My domain name is RushiAtUnikwork.
(and sorry Guus, I was rigid about posting frequently. This time I’m going step by step and will be asking pinpoint questions so it does not generate more confusion)

Dont the push Server requires another server to also be running ? like for example unifiedPush?
i did think that the Push server plugin would need to be connected to the unifiedPush which would then push the messages to the client. i never did implement it though.

Push Server has configuration for Firebase, won’t the next flow processed by Firebase.

What I understand is:
Push Notification plugin generates notification → Push Server receives it and forwards it to Firebase → Firebase sends it to appropriate device

Firebase is the google push server right? in that case it would sound correct too. but for really debugging dont we have to also know their side? maybe they are denying for some reason? i am not sure. if it was your pushserver you could look at both sided in the logs. but as it is not it complicate things a bit more it seems.

Maybe try a search for firebase error 400?

I don’t think nor you or me understand the flow of notifications and the use of plugins.

Let us know when you succeed this way the word can be spread.

Yeah, hopefully soon

I’m assuming that you’re using PSI+ only because it has a debugging feature that allows you to send raw XMPP - not because you expect it to receive push notifications.

It is entirely possible that the push server plugin does not properly respond to disco/info requests, which would result in the error that you’re getting. @hamzaozturk I that something that you can look into, if you’re availble?

@Rushi_Vaghasiya the ‘readme’ file of the Push Server plugin contains snippets of code in the section named “Registering Devices” that should get you proper responses, if the plugin is running & configured properly. I suggest trying that. Also, keep an eye on your log files for relevant feedback.

I’m assuming that you’re using PSI+ only because it has a debugging feature that allows you to send raw XMPP - not because you expect it to receive push notifications.

You are correct.


It is entirely possible that the push server plugin does not properly respond to disco/info requests, which would result in the error that you’re getting.

Okay


@Rushi_Vaghasiya the ‘readme’ file of the Push Server plugin contains snippets of code in the section named “Registering Devices” that should get you proper responses, if the plugin is running & configured properly. I suggest trying that. Also, keep an eye on your log files for relevant feedback.

Okay, currently I have a protoype web client (which I made using xmpp.js). The plugin doesn’t have any configuration option for web client (only for iOS and Android). Is there a way for web?

For mobile, will try when the mobile team gives me code for either Android or iOS.