Android GCM注册ID更改 [英] Android GCM registration ID change

查看:140
本文介绍了Android GCM注册ID更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个愚蠢的问题,但对我很重要。我正在开发一个使用GCM的应用程序。我对GCM进行了搜索和阅读,并提出了与此相关的一些问题:


  1. GCM的registration_id在应用更新后发生了变化?如果是,那么如何处理它?<​​/ li>
  2. Android更新后GCM的registration_id更改了吗?如果是,那么如何处理它?<​​/ li>
  3. 是否每次从同一设备和同一应用程序注册到GCM时注册ID都会发生变化?每次应用程序运行时,应用程序都需要调用注册GCM方法?
  4. 应用程序是否可以等待令牌或注册过程在后台完成?

  5. ol>

    我参考了此链接在我的应用程序中实现GCM。


    1. GCM的registration_id是什么?应用更新后更改?如果是,那么如何处理它?<​​/ li>

    Ans。 :是的,应用更新此处后,GCM的registration_id发生更改,您可以找到解释。


    1. Android更新更新后,GCM的registration_id是否更改?如果是,那么如何处理它?<​​/ li>

    Ans。 :是的,应用更新此处后,GCM的registration_id发生更改,您可以找到解释。


    1. 每次从同一个设备和同一个应用程序注册到GCM时,注册ID是否会发生变化

    Ans。 :不,只要应用程序未更新或设备的Android版本未更改,它就会一样。


    1. 每次应用程序运行时,该应用程序是否需要调用注册GCM方法?
    2. :如果您有一个应用程序,用户必须登录,那么在登录成功步骤中,您可以注册。而且它不需要太多时间来注册设备。如果ID改变了,它会给出新的ID,否则会返回旧的,所以不用担心重复或者这样的问题。


      1. 应用程序是否可以等待令牌或注册过程在后台完成?

      Ans。 :你也可以在后台线程中做到这一点。但它并不需要太多时间,所以你也可以正常进行。



      我希望能够回答你的问题。如果我在任何地方都错了,请告诉我。
      如果您同意我的意见,请接受我的答案。



      谢谢。


      I know this is a silly question but important for me. I am developing an application which uses GCM. I searched and read regarding the GCM and having some question related to this as:

      1. Is the registration_id of GCM change after App update? If yes then how to handle it?
      2. Is the registration_id of GCM change after Android update? If yes then how to handle it?
      3. Is the registration id changes with every time registration to GCM from the same device and same app?
      4. Do the app need to call registration to GCM method every time when app runs?
      5. Can the app wait till the token or registration process complete in background?

      I refereed the This Link to implement GCM in my app.

      解决方案

      I'll try to answer some of your questions.

      1. Is the registration_id of GCM change after App update? If yes then how to handle it?

      Ans. : Yes, registration_id of GCM change after App update here you can find explanation.

      1. Is the registration_id of GCM change after Android update update? If yes then how to handle it?

      Ans. : Yes, registration_id of GCM change after App update here you can find explanation.

      1. Is the registration id changes with every time registration to GCM from the same device and same app?

      Ans. : No, It'll be same as long as the app is not updated or android version of device is not changed.

      1. Do the app need to call registration to GCM method every time when app run?

      Ans. : If you have an app where user has to do login then at login success step you can but registration. And it doesn't take much time to register the device. If the id is changed, it'll give new id or else will return old one so no worries about duplication or such problems.

      1. Can the app wait till the token or registration process complete in background?

      Ans. : You can do this in background thread as well. But it doesn't take much time so you can do it normally as well.

      I hope, am able to answer you questions. Let me know if I am wrong anywhere. Accept my answer if you agree with me.

      Thanks.

      这篇关于Android GCM注册ID更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆