是否有適用於GCM Cloud Connection Server的Java API

[英]Is there a Java API for GCM Cloud Connection Server


I am just going through the new features of GCM Cloud connection server. On client side this seems fairly easy using the google play services, as described in https://developer.android.com/google/gcm/ccs.html, however for the server side it says:

我剛剛瀏覽了GCM Cloud連接服務器的新功能。在客戶端,使用谷歌播放服務似乎相當容易,如https://developer.android.com/google/gcm/ccs.html中所述,但是對於服務器端,它說:

GCM Cloud Connection Server (CCS) is an XMPP endpoint, running on http://gcm.googleapis.com port 5235.

GCM雲連接服務器(CCS)是一個XMPP端點,在http://gcm.googleapis.com端口5235上運行。

CCS requires a Transport Layer Security (TLS) connection. That means the XMPP client must initiate a TLS connection. For example in smack, you would call setSocketFactory(SSLSocketFactory), similar to “old style SSL” XMPP connections and https.

CCS需要傳輸層安全性(TLS)連接。這意味着XMPP客戶端必須啟動TLS連接。例如在smack中,您將調用setSocketFactory(SSLSocketFactory),類似於“舊式SSL”XMPP連接和https。

CCS requires a SASL PLAIN authentication mechanism using @gcm.googleapis.com (GCM sender ID) and the API key as the password, where the sender ID and API key are the same as described in Getting Started.

CCS需要使用@ gcm.googleapis.com(GCM發件人ID)和API密鑰作為密碼的SASL PLAIN身份驗證機制,其中發件人ID和API密鑰與“入門”中所述的相同。

Does that mean I manually have to open a port and parse xml/json or is there some kind of Java API that I can use to implement the server side?

這是否意味着我手動必須打開一個端口並解析xml / json,還是有某種Java API可以用來實現服務器端?

2 个解决方案

#1


2  

For the GCM Server there is a library, the javadoc is at http://developer.android.com/reference/com/google/android/gcm/server/package-summary.html

對於GCM Server,有一個庫,javadoc位於http://developer.android.com/reference/com/google/android/gcm/server/package-summary.html

There is a demo server app Google has written here at http://developer.android.com/google/gcm/server.html

谷歌在http://developer.android.com/google/gcm/server.html上寫了一個演示服務器應用程序

As I understand you can choose whether you want to use the XMPP service or the old HTTP service. Not sure what the advantage is.

據我所知,您可以選擇是要使用XMPP服務還是舊的HTTP服務。不確定是什么優勢。

#2


0  

You can use Smack library to work with XMPP in Java. And here you can find an example code that sends notifications using GCM CCS.

您可以使用Smack庫在Java中使用XMPP。在這里,您可以找到使用GCM CCS發送通知的示例代碼。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2013/06/20/725d4058b60472f32261c259b28384ce.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com