模拟器只得到了GCM消息? [英] Emulator only got GCM messages?

查看:123
本文介绍了模拟器只得到了GCM消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有prepared一个应用程序的GCM与 GCM帮助:入门入门。据工作fine.I得到了在emulator.I消息已经安装我的应用程序在device.when我从私人服务器发送邮件只得到了消息,但设备没有得到messages.I觉得已经做了一些错误,一些地方请指导我。

I have prepared one application for GCM with help of GCM: Getting Started. It is working fine.I got messages in emulator.I have installed my app in device.when i send messages from server emulator only got the messages,but devices not getting messages.I think have done some mistake some where please guide me.

推荐答案

你已经注册使用GCM的设备?
用于获取注册ID你必须做到以下几点code:

Did you register the device with GCM? for getting the Registration ID you have to do the Following code:

里面的onCreate()方法中添加以下code:

inside onCreate() method, add the following code:

GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals("")) {
  GCMRegistrar.register(this, SENDER_ID);
} else {
  Log.v(TAG, "Already registered");
}

在这里,你会得到REGID,你必须把它发送到服务器,使服务器可以发送推送通知到设备具有上述REGID。

here you will get regId which you must have to sent it to the Server so that server can send push notification to Device which has the above regId.

有关更多帮助,你可以参考这里

for More Help you can refer here

这篇关于模拟器只得到了GCM消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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