android gcm ccs(xmpp)连接

时间:2016-01-05 12:26:38

标签: android google-cloud-messaging xmpp

嗨我非常新的gcm和ccs我已成功设置并使用php运行gcm现在我正在设置ccs(xmpp)现在任何人都可以告诉在哪里添加接收器ID

new AsyncTask() {
            @Override
            protected String doInBackground(Void... params) {
                String msg = "";
                try {
                    Bundle data = new Bundle();
                    data.putString("my_message", "Hello World");
                    data.putString("my_action","SAY_HELLO");
                    String id = Integer.toString(msgId.incrementAndGet());
                    gcm.send(SENDER_ID + "@gcm.googleapis.com", id, data);
                    msg = "Sent message";
                } catch (IOException ex) {
                    msg = "Error :" + ex.getMessage();
                }
                return msg;
            }

            @Override
            protected void onPostExecute(String msg) {
                mDisplay.append(msg + "\n");
            }
        }.execute(null, null, null);

0 个答案:

没有答案