C2DM到谷歌云消息

C2DM到谷歌云消息

本文介绍了C2DM到谷歌云消息(GCM)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如你可能已经看到,谷歌正在迁移的推送通知系统。

As you may have seen, Google is migrating its Push Notification System.

谷歌开发者指南GCM

我想我不是一个人想知道:从C2DM获得的仍然有效GCM令牌

I guess I am not alone wondering : are the tokens obtained from C2DM still valid for GCM ?

如果没有,这意味着我需要我所有的用户使用新版本更新的标记在我的服务器上更新我的应用程序...

If not, it means that I need all my users to update my app with a new version updating the tokens on my servers ...

我可以保持并行系统这是一件好事,我不认为这是一个很好的解决方案。

I can keep the parallel systems which is something I don't think it's a good solution

继续使用C2DM,直到它完成,然后我死了吧: - )

Continue using C2DM until it's finished, then I die with it :-)

推荐答案

虽然客户端迁移是很容易(只是从电子邮件地址发件人更改为项目ID),你仍然会面临转型的头痛,如果你的应用程序已经使用C2DM一会儿。看到这里我的问题:发布GCM通知现有的C2DM注册IDS

Although client side migration is easy (just change the 'sender' from email address to a project id), you will still face transition headaches if your app has been using C2DM for a while. See my question here: Posting GCM notification to existing C2DM registration ids

基本上,问题是过渡期间,您需要从旧的C2DM应用程序维护设备注册的ID,并从较新的应用程序,使用GCM新章IDS。除非你可以强制所有用户升级一次全部,你必须建立额外的逻辑(即在数据库表中添加一个新列,表明GCM章ID)的服务器来处理发送通知到两个C2DM和GCM的可预见的未来。

Basically the problem is during the transition, you need to maintain device registration ids from the old C2DM app, and the new reg ids from your newer app that uses GCM. Unless you can force all your users to upgrade all at once, you have to build additional logic (i.e. add a new column in the database table to indicate GCM reg id) in the server to deal with sending notifications to both C2DM and GCM for a foreseeable future.

如果你的服务器只发送通知到所有设备,那么这应该是容易的迁移,你可以爆到数据库中的所有设备都C2DM和GCM的通知,并逐渐从旧的C2DM注册删除无效的还是那些NotRegistered设备。随着时间的推移,你会看到越来越少C2DM设备注册的ID在你的数据库中。

If your server only send notifications to all devices, then this should be easy migration, as you can just blast both C2DM and GCM notifications to all devices in your database, and progressively remove stale or those NotRegistered devices from the old C2DM registrations. As time goes by you should see less and less C2DM device registration ids in your database.

这篇关于C2DM到谷歌云消息(GCM)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 04:26