AnsweredAssumed Answered

Smack: StanzaListener.processPacket() are not called on GCM incoming message.

Question asked by Jae-Hun Jeong on Aug 23, 2015
Latest reply on Aug 24, 2015 by Flow



I'm programming GCM(Google Cloud Messaging) backend server with Smack 4.1.3.

Problem is when my backend receives first GCM incoming message, processPacket() doesn't called for that message.

But when second message arrives, processPacket() called for FIRST message.

Then third message comes, processPacket() doesn't called.

And on fourth message, processPacket() called for THIRD message.


My console debug log prints like this.

07:27:51 User logged (0):

07:27:51 XMPPConnection authenticated (0)

// First GCM incoming message.

07:27:56 RECV (0): <message to="" from="" ... "message_id":"15" ... </message>

// processPacket doesn't called

// Second GCM message comes.

07:27:58 RECV (0): <message to="" from="" ... "message_id":"16" ... </message>

// Then processPacket() for FIRST message called immediately. processPacket() just prints received XML message.

Received:<message to="" from="" ... "message_id":"15" ... </message>

// Third GCM message.

07:28:04 RECV (0): <message to="" from="" ... "message_id":"17" ... </message>

// processPacket doesn't called

// Fourth GCM message.

07:28:05 RECV (0): <message to="" from="" ... "message_id":"18" ... </message>

// processPacket() for THIRD message called.

Received:<message to="" from="" ... "message_id":"17" ... </message>



I googled about this and found same question about this on stackoverflow.

The link is this. -google-cloud-messaging-with-ccs

My code is nearly identical to above link's code.


Is it bug or am I missing something?

Thank you for your help.