GCM not working on Gingerbread, but is working on Ice Cream Sandwich

前端 未结 1 819
既然无缘
既然无缘 2021-01-26 04:05

I am writing a game that uses GCM messages. When one player enters turn moves to the server, the server will send a GCM message to their opponent letting that client know that

1条回答
  •  攒了一身酷
    2021-01-26 04:12

    I compiled the sample code for GCM messages. The only changes I made were to use the same API key and Sender ID that I'm using in my game application. This application works on both devices, so I can reconfirm there are no network issues and I can confirm that the X2 actually can receive GCM messages.

    The bad news was that the X2 still did not receive GCM messages for my game. After more research I discovered that when the server tries to send a GCM message to the X2 (for my game application only) the server receives an ERROR_NOT_REGISTERED result. There is no such error sending to the Xoom. I have confirmed that the server is successfully receiving the registration ID numbers. I know it's hard to tell, but the registration IDs do not get mangled in the transmission process.

    I tried a few different published recommendations on how to unregister the device from the GCM server but none seemed to work. I always received the same registration ID back again. So I completely uninstalled my game then reinstalled it on the X2. That forced it to get a new registration ID number which solved the problem. My game works properly on both devices now. I must assume that somehow the registration ID got mixed up somehow, between the game and GCM server, while I was debugging.

    I can only hope that this doesn't become a regular problem, as there doesn't seem to be a successful fix other than uninstalling the application.

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