0

I'm developing a app with UrbanAirship push notification feature. I'm getting pushId for registration. In iOS, it gives same pushId at all reinstallation of app but In Android, pushId changed at all reinstallation. I need same pushId at all reinstallation.

Plugin java file using this line of code :-

String pushID = PushManager.shared().getAPID();

I'm trying to use getChannelId() method but it gives error that no method found .

What can I do to achieve this required information.

Please give me some guidelines.

Amit Singh
  • 2,698
  • 21
  • 49
Ritesh Kumar Singh
  • 344
  • 2
  • 3
  • 19

1 Answers1

1

You will always get a new pushID on Android as that is how GCM works. It essentially is a new instance of the application. Because it's a new instance, your new instance will have a new ID. Furthermore, Urban Airship's phonegap is built on top of their native library, which is built on the OS's platform. In Android's case, this is GCM. Their docs are here on the matter, where it explicitly states:

You should not save the registration ID... . This is because the registration ID could become invalid by the time the app is restored, which would put the app in an invalid state

Again, Urban Airship is implemented on top of this, and therefore will not save that ID, and thus you will never receive the same pushID upon uninstalling and reinstalling.

Donato Perconti
  • 814
  • 2
  • 11
  • 28