Comments (9)
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.
Thanks a lot.. It worked :)
from xmppframework.
Please share how you did it?
from xmppframework.
It is not working for me by using enableBackgroundingOnSocket. Please help me. I am stuck.
from xmppframework.
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.
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.
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.
Thanks, Anything else that i can do to keep active connection in BG as well?
from xmppframework.
Use iOS default background modes enabled if you have no restrictions with respect to your app requirements :)
from xmppframework.
Related Issues (20)
- Crashes with XMPPStreamManagement
- How can we enable secure communication with Openfire 5223 port
- cocoa async socket crash in iOS 16 and Xcode 14
- XMPPFramework crash in iOS 16 and Xcode 14 HOT 9
- Use framework in Swift
- Package product requires minimum platform version 11.0 for the iOS platform, but this target supports 9.0 (in target from project 'XMPPFramework') HOT 3
- XMMP Back Ground Socket
- version 4.1.0 not available in cocoapods.
- Is stream management (XEP-0198) supported?
- FileTransfer - with Potential Fix: "Unable to send SI offer; the recipient doesn't have the required features."
- Message sending failure and returning same to sender with error code 406 HOT 2
- Loading XMPPMessage Archiving_ Contact_ CoreDataObject data stuck
- RFC 9266: Channel Bindings for TLS 1.3 support
- Transfer this repository because there is no changes since several years HOT 1
- Failed to decrypt OMEMO message HOT 1
- How to apply to join a private room? HOT 1
- Apple Privacy Manifest HOT 4
- operation timed out.
- XMPPFramework keeps disconnecting HOT 1
- Time to move the project to community HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xmppframework.