2

I'm working on my backend app GCM server and from my understanding of the documentation every downstream message my app server sends should receive an ACK if successful or NACK if there's an issue. I'm able to send downstream messages successfully as my app is receiving them, but I never get any ACKs. I tried testing NACKs by putting in a bogus registration ID for when sending a downstream message but still get nothing.

I'm using the smack library and I've tried sending downstream messages with both

XMPPTCPConnection.send()
XMPPTCPConnection.sendStanzaWithResponseCallback()

And neither give a response. Am I missing something?

Leonardo Casale
  • 472
  • 5
  • 13

1 Answers1

2

Ok so I figured this out! I was following some sample code from here and found that the StanzaFilter being used makes sure the listener only sees requests that contain your SENDER_ID. I'm not sure if things used to be different but the ACKs and NACKs don't contain the SENDER_ID so they were being filters out from my listener.

I've now replaced my StanzaFilter with connection.addAsyncStanzaListener(this, MessageTypeFilter.NORMAL); instead of the custom filter from the example. I plan on adding a basic server to GitHub with all of my findings for others looking to implement their own server.

Community
  • 1
  • 1
Leonardo Casale
  • 472
  • 5
  • 13