question

adm-ms avatar image
adm-ms asked

ADM Registration ID refresh rate

Hi, After our app registered successfully to ADM server, how long does the registration ID last? How often does the ADM server refresh the registration ID (assuming it also returns a different registration ID)? Thanks
amazon device messaging
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bipin@Amazon avatar image
Bipin@Amazon answered
Hi, The ID is unique per install of the app, on a given device, for a specific user. If the user uninstalls then re-installs your app, you MAY receive a new registration ID. You can parse the response got after sending message to the specific device. when the request is successful. The response contains the canonical Registration ID for the specific instance of your app, which may be different that the one used for the request. At this point the data structure that stores the Registration ID values should be updated with the correct Registration ID for this particular app instance. String responseContent = parseResponse(conn.getInputStream()); System.out.println("responseContent -"+responseContent); JSONObject parsedObject = new JSONObject(responseContent); String canonicalRegistrationId = parsedObject .getString("registrationID"); // Check if the two Registration IDs are different. if (!canonicalRegistrationId.equals(registrationId)) { System.out.println(" UPDATE OLD DEVICE ID WITH NEW ID "); } This will keep it dynamic and not worry about the refresh rate.Hope this answers the issue.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

adm-ms avatar image
adm-ms answered
Can we use the canonical Registration ID as the new registration ID? or the app instance needs to explicitly request a new one and send to our server?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bipin@Amazon avatar image
Bipin@Amazon answered
canonical Registration ID is the new registration ID.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.