Can't connect to GCM using node-xmpp client

后端 未结 3 927
悲哀的现实
悲哀的现实 2021-01-22 17:23

I am attempting to run gcm server using node-xmpp, but xmpp client does not seem to open at all and closes after timeout.

var xmpp = require(\'node-xmpp-client\'         


        
相关标签:
3条回答
  • 2021-01-22 18:01

    I got the same problem and found out that the Connection.startStream() was never called, although the socket was opened successfully.

    Here's my pull request: https://github.com/node-xmpp/node-xmpp-client/pull/61

    Until it gets merged, you can use my fork, which should work for GCM: https://github.com/Riplexus/node-xmpp-client

    0 讨论(0)
  • 2021-01-22 18:17

    I have given up the hope of using node-xmpp and game smack client a try. Sadly it did not work, but I did get an error saying my project is not whitelisted. When project is whitelisted, it can receive messages from android devices, which is exactly what I need and is the sole reason why I went straight to CCS (XMPP). Without the whitelist, it is not possible to use CCS (XMPP) for sending the messages to android devices. In order to use HTTP method, the project does not need to be whitelisted, but has a limitation to being able to send messages only. I have signed up upstream GCM but have yet to receive response.

    https://services.google.com/fb/forms/gcm/

    0 讨论(0)
  • 2021-01-22 18:19

    I followed this from gcm google groups and it worked for me. And for timeouts you can try xmppClient.connection.socket.setTimeout(0) xmppClient.connection.socket.setKeepAlive(true, 10000) Don't forget to whitelist your server ip in google console.

    0 讨论(0)
提交回复
热议问题