Pregunta

Estoy intentando conectarse a Gmail usando API TORTAZO a través del servidor XMPP. pero conseguir la

Error: la autenticación SASL no usando el mecanismo NORMAL

se puede comprobar una visión de código. Me lo dio neta única

ConnectionConfiguration connConfig = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
connection = new XMPPConnection(connConfig);
connection.connect();
SASLAuthentication.supportSASLMechanism("PLAIN", 0);

he comprobado en la ventana de depuración tortazo. se dice en XML:

Ya estoy teniendo cuenta en Gmail y Gtalk mi también está en marcha.

¿Fue útil?

Solución

Es necesario configurar la autenticación antes de conectarse a saber

SASLAuthentication.supportSASLMechanism("PLAIN", 0);

debe aparecer antes connection.connect().

.

Otros consejos

    ConnectionConfiguration cc = new ConnectionConfiguration(
            "vietnam.agilemobile.com", 5222, vietnam.agilemobile.com");
    XMPPConnection connection = new XMPPConnection(cc);
    try {
        SASLAuthentication.supportSASLMechanism("PLAIN", 0);
        connection.connect();
        Log.e("LOGIN", "" + 111);
        // You have to put this code before you login
        Log.e("LOGIN", "" + 222);
        // You have to specify your gmail addres WITH @gmail.com at the end
        connection.login("nemodo", "123456", "resource");
        Log.e("LOGIN", "" + 333);
        // See if you are authenticated
        System.out.println(connection.isAuthenticated());

    } catch (XMPPException e1) {
        e1.printStackTrace();
    }

También conseguir este error, pero no puedo trabajar.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top