Android C2DM : Duplicate message to the same device and App

后端 未结 5 457
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-17 21:25

I\'m wondering if anyone has faced this issue with Google C2DM? This is the scenario I am faced with:

  1. User installs the app and registers with C2DM server for
5条回答
  •  滥情空心
    2021-01-17 21:49

    Not sure if this is the best approach, but there's a relevant thread over at the android-c2dm group, where the poster offers one technique:

    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.

提交回复
热议问题