Tag: google cloud messaging

GCM连接错误

我正在尝试使用XMPP(CCS)实现gcm服务器应用程序,我无法连接到谷歌服务器。 我正在尝试http://developer.android.com/google/gcm/ccs.html中的示例代码 当我尝试连接 ccsClient.connect(userName, password); 我收到以下错误 gcm.googleapis.com:5235 Exception: XMPPError connecting to gcm.googleapis.com:5235.; : remote-server-error(502) — caused by: XMPPError connecting to gcm.googleapis.com:5235.: remote-server-error(502) XMPPError connecting to gcm.googleapis.com:5235. — caused by: java.net.ConnectException: Connection timed out: connect at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:592) at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1010) at SmackCcsClient.connect(SmackCcsClient.java:249) at Sample.main(Sample.java:342) Nested Exception: XMPPError connecting to gcm.googleapis.com:5235.: remote-server-error(502) XMPPError connecting to gcm.googleapis.com:5235. — caused […]

在实施基于GCM XMPP的App Server时,无法将XMPP服务器与smack:EOFexception连接

java.io.EOFException: no more data available – expected end tag to close start tag from line 1, parser stopped on END_TAG seen …… @1:344 at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3035) at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046) at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144) at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:279) at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44) at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70) //资源: https : //developer.android.com/google/gcm/ccs.html#implement 我已经尝试了在android网站上给出的确切代码,但它正在抛出文件exception结束,我认为这是MXParser中的一些错误(虽然不太确定)。 如果smack XMPP库是问题,是否有任何其他xmpp库可以用于GCM CCS? 任何人都可以帮我解决这个问题。 在下图中,您可以看到结束流标记未关闭,但这是我收到数据包的方式。 发送和接收数据包输出窗口:

使用smack库在JAVA中实现GCM CCS(XMPP)。 gcm.googleapis.com连接失败

我正在尝试GCM在android客户端和java中的服务器应用程序之间进行通信。 我正在使用基于XMPP的GCM,因为我需要异步的双向消息。 在我的客户端,1。Google Play服务检查显示需要更新。 google play services is out of date. Requires 4242000 but found 3136130 Api等级-17,使用AVD和谷歌API,Android 4.2.2谷歌播放服务修订版15如何解决这个问题? 但我可以成功注册该设备。 在服务器端,我使用2.我使用smack库3.4.1我使用谷歌文档中的示例代码。 我收到以下错误 gcm.googleapis.com:5235 Exception: XMPPError connecting to gcm.googleapis.com:5235.; : remote-server-error(502) — caused by: XMPPError connecting to gcm.googleapis.com:5235.: remote-server-error(502) XMPPError connecting to gcm.googleapis.com:5235. — caused by: java.net.ConnectException: Connection timed out: connect at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:592) at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1010) at SmackCcsClient.connect(SmackCcsClient.java:247) […]

Google GCM XMPP代码示例

因此,Google曾经有一个很好的页面,他们提供了有关如何在此页面上实施GCM Xmpp服务器的代码示例: https : //developers.google.com/cloud-messaging/ccs 每当我想查看关于Google GCM XMPP的实现时,我都会给这个答案添加书签 但是,答案中的所有内容都消失了。 谷歌删除了它们。 但是现在,他们已经删除了所有内容,并添加了一个只解释其function的页面。 当然,但样本java代码会很好。 我试图访问github上的示例站点,它们链接到https://github.com/google/gcm 但它只提供HTTP GCM服务器版本的示例。 有人可以指点我工作的代码示例吗? 或者是否有一个可以与c#一起使用的库? 如果没有,我也会满足于java版本。 谢谢。