swifter icon indicating copy to clipboard operation
swifter copied to clipboard

Swifter does not work on iOS Device in Background

Open flashspys opened this issue 8 years ago • 7 comments

Swifter does not start its server in a UIBackgroundTask That is the reason why the Swifter Demo App does not work on a real iOS Device but in iOS Simulator. It's very important to start the server in a Background Task. Otherwise the app wont answer for Example to the request when you access your webpage from MobileSafari!

flashspys avatar Oct 07 '15 20:10 flashspys

hmm... I've been using Swifter in production and have had no problems running it on a device. https://github.com/Kitware/arctic-viewer-ios

tristaaan avatar Oct 08 '15 02:10 tristaaan

Maybe try the following: Start the Swifter Demo App on a real device. Then press home button and open Safari and try to access localhost:8080 . On my devices it wont load. Only after I switch back to Demo App and switch back again to Safari I can see the loaded content

flashspys avatar Oct 08 '15 21:10 flashspys

For what it's worth, I'm using the last version of swifter compatible with Swift 1.2. Perhaps something small has changed that causes the reported issue?

tristaaan avatar Oct 08 '15 21:10 tristaaan

I notice the same behavior as tristaaan. The application cannot run in the background, so it must have focus on your iPhone to process your requests. Additionally, I cannot connect to the web server from other devices on the network.

sjbodzo avatar Oct 09 '15 16:10 sjbodzo

If you'd like to try the application I mentioned App Store link, but again it's using an older version of swifter. I see the backgrounding problem now, but while the app is active I've had no problems accessing the server from other computers and devices on the same network.

tristaaan avatar Oct 09 '15 17:10 tristaaan

When the app is active, everything works as far as I know fine. But I think Swifter should handle the situation that the webserver is called when Swifter is in background.

flashspys avatar Oct 09 '15 17:10 flashspys

I have the same problem. Have anyone solved it?

kaaaaai avatar Nov 26 '21 09:11 kaaaaai