RUNNING socket.IO-objc IN background - ios

I am working in iOS app Development .I am using
pkyeck/socket.IO-objc in my app to implement scoket connection. My Socket connections working well while the app running in foreground.but if my app goes to background the socket connections are stopped to work. please tell any suitable solutions to run app in background too. Thanks

This is in the project capabilities, it is called "Background mode" iirc. Here is a tutorial describing more details.
Basically, I suppose you want the "fetch" background mode.
https://www.captechconsulting.com/blogs/ios-7-tutorial-series-whats-new-in-background-multitasking

Related

How to keep XMPP connection alive in the IOS App when app in background?

I have create basic chat app with XMPP Server in swift 2 (from this tutorial: http://shubhank101.github.io/iOSAndroidChaosOverFlow/2016/08/Chat-Application-Using-XMPP-Swift-Tutorial). My app is working good. but when my app went into background then my app unable to receive any message from XMPP server. i think this is because of XMPP connection break while entering the app in background.
i have tried to found the help on google for the same but nothing found related to Swift 2
Please help me. if some one put some sample code that would very helpfull for me because i m new to IOS development.
Third-party apps on the iOS are not allowed to keep network connection in background. See Apple guidelines how to avoid background networking.
You need to create a background thread to maintain XMPP connection. You can follow this tutorial to see how background thread works. https://thatthinginswift.com/background-threads/

Running IOS Application in the Background new developer

I am new IOS developer using swift. I have created a Radio App (streams Live). I want to make it to run in the background when user minimize the app or do some other stuff. Right now, it stops streaming audio as soon as sent to background and continuous again as soon as it is brought to foreground.
I searched few articles and other forums, but couldn't find any help. I am really new to IOS development and don't know about controls/functions in the AppDelegate.swift.
So far I enabled the option under Project Capabilities Tab as following also made change in info.plist file, however Application still stops as soon as enters in the background.
Any word of advice will be greatly appreciated. Thanks for your time and views.
I have adding the bool to info.plist file saying "Application does not run in the background = "NO"
Now I can run app in the background. I hope this solve the problem for others as well.

how to open another application from background using Custom URL scheme in iOS

I want to develop an Enterprise Application. It will run in the background continuously and from the background i want to open an another application. Its like toggle between two application. I have implemented forever background running with help of Location services which is working fine and also updating the location from the background but it is unable to execute openURL method.
Please suggest something.Thanks
It's not possible!
You can use these links only.
https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html
I will extend a little bit on MobiDevCom answer.
I haven't found a good publicly known solution.
The direct approach (trying to open something from background using all kinds of public or private API) ends up requiring all kinds of entitlements. I tried at least dozen of things about a year ago and reverse engineered quite a lot of iOS components.
The only idea which I found was usage of MDM Guided mode (however, a device needs to be supervised and enrolled into MDM for that).
BTW. Here is the question which I asked - Show some UI from background in audio player or VOIP app on iOS

What's solution to make task background in iOS same service in Android?

I'm newbie iOS. I have been develop Phonegap for Android and iOS. My App is update data from server every 1hour. In Android, i use service to do that. My app in Android working very good. Now, i want to develop version for iOS, and i have problem when update data from server every 1hour. I was research but not find anyway for my app.I don't know what's solution to replace for service in Android. Can you help me, what's solution. This have been kill me. Thank you so much.
Short answer is NO as Apple has restriction on background task running especially cases like yours.
But if you are downloading small amount of content, you do have some other options. From IOS 4.0 or above, you can declare your app to run in background when you fall under the following categories:
Audio
Location updates
Voice over IP
Newsstand downloads
External accessory communication
Bluetooth networking
Bluetooth data sharing
Background fetch (IOS 7)
Remote notifications (IOS 7)
In order to do so, you need to flag your app in the info.plist for Required Background Modes option. Apple will review your app specific in this area once you declared the option.
For your case to download the data, the possible option is to use the new feature in IOS 7 that's the background fetch or remote notification above. The suggestion from DOM was not asking you to download the content through push notification. But instead to use push notification to wake up your application and start downloading new content.
If you don't want to use push notification, the only way to go is register for background fetch. However, no matter which option you want to use, each download will only last for 30 seconds. And after that, your app will put into suspension mode again.
you can have a look on the link here:
Declaring Your App’s Supported Background Tasks
I think your best bet would be to use the push services instead of having your app go get data. Making your app do it is unreliable with phonegap apps because you cant create a service interface and you can not guarantee that your app will be running. With push service though, if your app isn't running, it will be woken up in a manner of speaking.
Take a look at this great how-to article that also discusses what push provides you.

Once and for all, does app with background location boot itself after reboot?

I've read a lot of questions here, some says there is a need to set VOIP mode and the app should boot itself after reboot.
But my app mostly do background location based stuff.
My app is not VOIP based but it is necessery to restart it after reboot.
Is there any way to do it or it can never be done?
By the eay, I set the VOIP key in the plist file and my app still not boot itself after reboot.
Any ideas mates?
Here is an example to test to make sure you are implimenting everything correctly. Everyone reports this to work properly with the voip key added.
VoIP iOS example

Resources