0

我正在使用 smack 3.2.1 API 制作 gtalk。我被群聊实施困住了。这是我发起群聊的代码:

conf = new MultiUserChat(connection, "room@groupchat.google.com");  // create object of multiserchat class

         try 
         {  // Create the room
            conf.create("room@groupchat.google.com");

            // Send an empty room configuration form which indicates that we want an instant room
            conf.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
         } 

         catch (XMPPException e) 
         {
            Toast.makeText(this, "Error in create room: "+e.toString(), Toast.LENGTH_LONG).show();
         }

conf.invite("userid", "Invitation for group chat");

但我收到错误:服务不可用 (503)

提前致谢。

4

1 回答 1

2

房间应该是--私人聊天-

而且没有必要创造空间。

只需使用用户名和密码加入房间。这将满足:

代码片段:

String room = "private-chat-" + UUID.randomUUID().toString();
room = room + "@groupchat.google.com";
MultiUserChat muc = new MultiUserChat(cc, room);
    muc.join("username", "password");
    muc.invite("username", "hi");

让我知道这个是否奏效。

于 2012-01-06T04:40:53.637 回答