0

First let me explain my scenario:

[Android App]

When it start, it send the regID (for push notifications) to our server (in php)

[SERVER]

In the server I have a list like:

Android Name: john

ID: 9012903482190381290839012839012890-dfs-234--23431243124

..

Android Name: james

ID: 901fdsfdsfdsfdsfert545tertert12890-dfs-234--23431243124

PROBLEM: When I update the app, the gogole cloud generates a new regID for the same device, and I have to check in the server if that user exist (but maybe there are another user with the same name) and replace the ID.

1-There is a way to conserve the ID for the same device in android? (like in iOS)

2-There is a way to know the old redID (ID for push notification) in the new app update?

Thanks for your time.

Joan

Kotik_o
  • 295
  • 6
  • 19
  • That ID can change under many different circumstances. What if the user uninstalled your app then reinstalled it? The same thing would happen. -- What you should be doing is have some kind of unique identifier for each specific user in your database (eg. username/email) and use that to map it to the regID. – Cruceo May 07 '14 at 16:49
  • Yes, you are right. Maybe using wifi MAC. Thanks. – Kotik_o May 08 '14 at 10:18
  • That address can change, too. But if you're really against letting them enter unique info, you could probably do something like scrape the primary account of the device and log that, as most Androids will have some form of account associated with the device with something like: http://stackoverflow.com/a/2175688/1426565 granted, they may not, but it's a pretty tiny margin for error – Cruceo May 08 '14 at 14:35
  • MAC can change , really? wow.. Android is amazing... OK, but if I get android account (xxxx@gmail.com), I can install in 2 android the same account, right? Are you sure that MAC can change? I thing that WhatsApp is using the MAC with special HASH to get ID of your phone... – Kotik_o May 08 '14 at 17:29
  • About the MAC address: http://stackoverflow.com/a/10295414/1426565 And generally if the same person's device, I'd assume odds are they're using the same account. Again, your best option is still asking them to enter something unique, because it won't always be the case that's true. – Cruceo May 08 '14 at 19:24

0 Answers0