lundi 29 juin 2015

How to reconnect to open fire server after unlocking the iPhone screen?

I am using XMPPFramework. My XMPP connection is always closed when I locked the iPhone screen. I need to reconnect to my open fire server when I unlock the screen.

Here is how I used XMPPReconnect (in Swift):

func xmppStreamDidAuthenticate(sender: XMPPStream) {
    let xmppReconnect = XMPPReconnect()
    xmppReconnect.activate(sender)
    xmppReconnect.addDelegate(self, delegateQueue: dispatch_get_main_queue())
}

However, it seems it never reconnects when I unlock the screen. Am I using XMPPReconnect correctly?

How do I achieve my target?

Aucun commentaire:

Enregistrer un commentaire