ios - Messenger cannot connect to a XMPP server from the first attempt -
i wrote 2 functions:
if let stream = xmppstream { if stream.isauthenticated(){ println("logged in") } else { println("something wrong") } } func xmppstreamdidconnect(sender: xmppstream) { println("xmppstreamdidconnect") isopen = true var error: nserror? if (xmppstream!.authenticatewithpassword(password.text, error: &error) ) { println("authentification successful") performseguewithidentifier("gotobuddylist", sender: nil) } }
and when run app prints in terminal:
something wrong xmppstreamdidconnect authentification successful
even if putted true credentials prints @ first [something wrong] , later [authentification successful]. why happens?
i want alert users in case of [something wrong], not in [successful] case, alert in successful case, too.
implement xmppstreamdidauthenticate , didnotauthenticate methods of xmppstreamdelegate .
after calling authenticatewithpassword client authentication surely end in above 2 function (xmppstreamdidauthenticate , didnotauthenticate) until stream.isauthenticated() return “0”.
Comments
Post a Comment