Giter Club home page Giter Club logo

Comments (9)

jelledelaender avatar jelledelaender commented on September 25, 2024

In the XMPPStreamDelegate, add next method:

/**

  • This method is called after the tcp socket has connected to the remote host.
  • It may be used as a hook for various things, such as updating the UI or extracting the server's IP address.
  • If developing an iOS app that runs in the background,
  • please use XMPPStream's enableBackgroundingOnSocket property as opposed to doing it directly on the socket here.
    **/
    • (void)xmppStream:(XMPPStream *)sender socketDidConnect:(GCDAsyncSocket *)socket

Simply set the enableBackgroundingOnSocket property on the socket and it should work.

from xmppframework.

swathi-gali avatar swathi-gali commented on September 25, 2024

Thanks a lot.. It worked :)

from xmppframework.

guptatarun84 avatar guptatarun84 commented on September 25, 2024

Please share how you did it?

from xmppframework.

parthpatel1105 avatar parthpatel1105 commented on September 25, 2024

It is not working for me by using enableBackgroundingOnSocket. Please help me. I am stuck.

from xmppframework.

guptatarun84 avatar guptatarun84 commented on September 25, 2024

You need an push notification once the user is offline to enable app which is in background and immediately make an connect request to XMPP to get the app alive from background. In my case I used the same mechanism.

from xmppframework.

Amitmundra avatar Amitmundra commented on September 25, 2024

If app in background and when we take the app in foreground after 30 minutes then it autoreconnect event doesn't fire, Should XMPP library do this or should we do something else to make connect automatically?

Thanks.

from xmppframework.

guptatarun84 avatar guptatarun84 commented on September 25, 2024

Auto reconnect only happens when there is network issue. Incase you need application to wake up from background mode you need to enable push notification through which the application would become active and send a connect request within 30 secs of the whole procedure. Although this is not a full proof solution due to restriction provided by Apple however will work.

from xmppframework.

Amitmundra avatar Amitmundra commented on September 25, 2024

Thanks, Anything else that i can do to keep active connection in BG as well?

from xmppframework.

guptatarun84 avatar guptatarun84 commented on September 25, 2024

Use iOS default background modes enabled if you have no restrictions with respect to your app requirements :)

from xmppframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.