0

I am using Uniqush to send GCM messages to an app I'm developing, and so far this is working well. However, for obvious reasons I am uninstalling and reinstalling the app as I develop, and it's re-registering for GCM with each new install.

I understand GCM is supposed to handle this automatically:

http://developer.android.com/guide/google/gcm/adv.html#unreg

if a message can't be delivered to a device, it sends an error to the server, which handles it. Unfortunately (even after sending a test push message while the app wasn't installed) I am getting duplicate messages to my device.

Is this a failure in Uniqush, my program, GCM, or some combination of the three?

Andrew Wyld
  • 7,133
  • 7
  • 54
  • 96

2 Answers2

0

If notifications are sent to a device while it has the app uninstalled, eventually the duplicates clear.

Andrew Wyld
  • 7,133
  • 7
  • 54
  • 96
0

Given your description, I am unable to reproduce your situation. Here are the steps to try to reproduce it:

  • Install the test app on my phone and push notification to it using uniqush. Correct. Uniqush's log shows it is successfully delivered and my phone shows the correct result.
  • Uninstall the test app.
  • push another notification again using uniqush. Uniqush's log shows the message saying the user is unsubscribed the service: [Unsubscribe][Info] 2012/12/21 19:18:08 [UnsubscribeRequest] RequestId=3992a14e4987e94e3ce16bb7394ee06d2d9e7231 Success DeliveryPoint=gcm:47e6551857be173b1418e56b63dbdb8cd58c94a2
  • Then push one more notification to the device, uniqush says it cannot find the device (because it has already been removed.)
  • Check the database using redis-cli, the device's information is no longer stored. It is successfully unsubscribed.

However, I did found some problem: if you check the error message returned from uniqush from HTTP, then you will see Success on the second notification. I have already fixed this bug in next release. It will be online soon. (If you are interested in that, check the .deb package )

In fact, uniqush is designed to be able to handle such situation so that the user don't need to care about unsubscription, device token/registration id update, etc.

If you have any future question, please feel free to comment or contact me.

monnand
  • 395
  • 1
  • 3
  • 8