Duplicate C2DM after reinstalling app

417 views
Skip to first unread message

Atlusr1

unread,
Jul 12, 2011, 4:44:03 PM7/12/11
to android-c2dm
I am having the same issue described in this post

http://groups.google.com/group/android-c2dm/browse_thread/thread/cb7e9fbe29fb5048/d7240af8a4f75601?lnk=gst&q=duplicate#d7240af8a4f75601

I read and didn't know if there was a solution. For some reason, I
can't reply to that post to ask my question, so I am posting it new
here.

Essentially it's the same problem:

1) User installs the app and subscribe for c2dm (registration key is
sent to app server)
2) User uninstalls the app.
3) User reinstalls the app and subscribes for c2dm (new registration
key is sent to app server)

Now I have 2 registration keys on app server for the same device and
same app.

I thought about tracking device Id, it doesn't seem like a good idea
after reading http://android-developers.blogspot.com/2011/03/identifying-app-installations.html

and tracking app installation alone i will still end up with two
registration keys.

What is the solution? How do I notify the app server when User
uninstall an app? Thanks



Atlusr1

unread,
Jul 14, 2011, 4:15:47 PM7/14/11
to android-c2dm
Figured it out myself. I am sending registration id in the message,
so I can check it against the stored registration id on the device.

If it's not the same, discard it and notify the service that
registration Id is no longer in use

Downside is sending registration Id takes up some space in already
limited message size. But works perfectly in my case since my
original message is no more than a few chars long.


On Jul 12, 4:44 pm, Atlusr1 <atlu...@gmail.com> wrote:
> I am having the same issue described in this post
>
> http://groups.google.com/group/android-c2dm/browse_thread/thread/cb7e...
>
> I read and didn't know if there was a solution.  For some reason, I
> can't reply to that post to ask my question, so I am posting it new
> here.
>
> Essentially it's the same problem:
>
> 1) User installs the app and subscribe for c2dm (registration key is
> sent to app server)
> 2) User uninstalls the app.
> 3) User reinstalls the app and subscribes for c2dm (new registration
> key is sent to app server)
>
> Now I have 2 registration keys on app server for the same device and
> same app.
>
> I thought about tracking device Id, it doesn't seem like a good idea
> after readinghttp://android-developers.blogspot.com/2011/03/identifying-app-instal...

Stephan Roorda

unread,
Sep 22, 2011, 10:43:40 AM9/22/11
to androi...@googlegroups.com
Unfortunately I have hit this problem as well.  This seems to be the only way to handle this.  Unless someone else has come up with something better or a way to do the unregister on uninstall.
Reply all
Reply to author
Forward
0 new messages