GCM Registration ID changed

后端 未结 2 2073
醉话见心
醉话见心 2020-11-30 07:19

I developed an application which used GCM technology and everything is OK.

I observed that the registration ID of the device changes after a period of time and this

2条回答
  •  天涯浪人
    2020-11-30 07:35

    The 'periodical' refresh never happened, and the registration refresh is not included in the new GCM library.

    The only known cause for registration ID change is the old bug of apps getting unregistered automatically if they receive a message while getting upgraded. Until this bug is fixed apps still need to call register() after upgrade, and so far the registration ID may change in this case. Calling unregister() explicitly usually changes the registration ID too.

    The suggestion/workaround is to generate your own random identifier, saved as a shared preference for example. On each app upgrade you can upload the identifier and the potentially new registration ID. This may also help tracking and debugging the upgrade and registration changes on server side.

提交回复
热议问题