Pergunta

I am using GCM to send notification in android using GCM. Sometimes it gives canonical id as "1" and as their document we need to replace new notification key that comes with the response. I want to do this. For this i have to reproduce this error. What is the way to do so ?

Foi útil?

Solução

Steps to produce Canonical error while sending notification using GCM

  • The initial state : Application is installed on Android device and is registered to GCM. Sender server has the registration Id and manages to send messages to that device.

  • Uninstall the application.

  • Send two messages to the original (old) registration Id. The first will seem to work (server will receive a successful reply from GCM server). The second attempt will result in a "NotRegistered" error.

  • Re-install the application and register to GCM. The device will get a new registration Id.

  • Send a message using the old registration Id. The application will receive the message, but the server will get in the reply the new registration Id as canonical registration Id.

Source : https://stackoverflow.com/a/12978274/2189626

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top