从C2DM迁移到GCM [英] Migration from C2DM to GCM

查看:173
本文介绍了从C2DM迁移到GCM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读,但我不明白我的必须做。现在我的应用程序通过以下代码在c2dm中进行注册:

 字符串pushId = C2DMessaging.getRegistrationId(this); 
if(pushId ==)
{
C2DMessaging.register(this,email@gmail.com);
}

在这段代码中我必须改变从c2dm到gcm的迁移吗?

解决方案

首先,浏览入门步骤。一旦你创建了一个API项目,你将会收到一个'项目ID',如该文件中提到的第4项:

  Take #project后的值注释:(本例中为4815162342)。这是您的项目ID,稍后将作为GCM发件人ID使用。 

所以您只需将您的代码更改为:

  C2DMessaging.register(this,4815162342); 

senderID必须是字符串数字。



我使用'入门'指南中的示例,您应该用您自己的项目ID替换发件人ID。

最后,通过
GCM架构概览,因为您需要对所有这些服务器进行一些更改去工作。


I reading this, but I don't understand what I must do. Now my application doing registration in c2dm by this code:

String pushId =  C2DMessaging.getRegistrationId(this);
if(pushId == "")
{
    C2DMessaging.register(this, "email@gmail.com");
}

What I must change in this code to do migration from c2dm to gcm?

解决方案

First, go through the Getting Started steps. Once you created an API project, you will receive a 'Project ID', as mentioned #4 item on that document:

Take note of the value after #project: (4815162342 in this example). This is your project ID, and it will be used later on as the GCM sender ID.

So you just need to change your code to:

C2DMessaging.register(this, "4815162342");

The senderID must be a string number.

I am using the example from the 'Getting Started' guide, you should replace the sender ID with your own Project ID.

Finally, go through the GCM Architectural Overview, as you need to make some changes to the server for all of these to work.

这篇关于从C2DM迁移到GCM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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