Objective-C/CocoaHTTPServer - Is it possible to run CocoaHTTPServer as a background app without any UI? - ios

I want to run CocoaHTTPServer as an independent background app which doesn't have any screens. Other apps in the device should be able to communicate with this app for remote server connectivity. Is it technically possible in iOS ?
Any suggestions are greatly appreciated.

No. It is not possible. CocoaHTTPServer is a small, lightweight, embeddable HTTP server for Mac OS X or iOS applications. It can't be run as a standalone application. It has to be added as a part of an application. The server is running only while application is in foreground. As soon as you exit from the application (by switching to another app or locking a device) the server will be stopped. The server will be restarted when you enter the application again

Related

iOS web app not working offline in homescreen app, but working in Safari

I have a basic create-react-app app that I tested on my iPhone 8 (through localhost). The service worker registers properly when using Safari, but after adding the app to my homescreen and launching from there, the service worker doesn't work and I get the "Safari could not load the page because your iPhone is not connected to the internet" message. How can I fix this?
Fixed it!
For some reason, service workers work through localhost on iOS, but have weird behaviour unless they are hosted on an HTTPS host. I was able to fix this problem (and one other where an image wasn't loading after disappearing and reappearing) by hosting the production build on a DigitalOcean server.

How to make mobile applications install and run in CHINA?Any option for the app to work without using VPN?

Recently, I gave an iOS build to my client to test an app. I did it by using Unity and ARKit. From the client's feedback, he downloaded the application but the app is not initializing. In order to let the app to initialize, it requires Internet connection. I used a Plugin in my app when I contacted them, they told me that they are using Google's Firebase in their backend. Is this the reason that the app has been blocked or any other issues? Any suggestion?.
Btw, my client cannot use VPN. Is there a way to run something in code to change to VPN?

When does ReactJS Native proxy to your server, and how do you get it to run on an iOS device for real, independently of the server?

I ran a fledgling ReactJS Native / iOS app under development from the simulator, and noticed that when I tested it on my iPhone, it immediately crashed because the device couldn't talk to its own 127.0.0.1:8081. (The solution to this was to change a setting so it referred to my machine's IP.)
When does ReactJS Native proxy to your server, and how (some more formal app installation process?) do you get it to run on an iOS device for real, independently of your development box acting as a server?

Can iOS apps communicate via sockets?

I'm going to develop few apps for iOS. Can they communicate to each other via sockets? Let's say one app runs as server (even in background mode) and another as client connects to server app and perform some communication. Does it violate any App Store rules? Any available IPC in iOS if my idea is not working for some reason?
Of course you can and it doesn't violate any rules.
Just just the CoreFoundation libraries.
There's no point in me describing it to you if it already has been all written in the official Apple documentation:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/UsingSocketsandSocketStreams.html
You can find here examples, all approaches and things you can and cannot do.
EDIT:
You didn't make that clear but it seems like you wanted the apps to run on the same device. You can do that but that would mean that one app has to run in background, and to do that you need some kind of hack (for example: background updating location mode ON) and that won't get past apple store. You need a very good reason to have your app ran in background (music in background, update location in background for fitness apps etc.)
Besides, it's a duplicate question:
iOS - Is it possible to communicate between apps via localhost?
As long as your apps are in the same app group, then yes, socket IPC is allowed. If not, then no. Sockets map to file descriptors (Berkeley sockets), and these files are sandboxed to the app or app group. More info: http://ddeville.me/2015/02/interprocess-communication-on-ios-with-berkeley-sockets

Remote Access a PhoneGap App

I wanted to make an application for the iPad that will be controlled from an iPhone-app. Is there a possibility to access the PhoneGap-App on the iPhone?
I don't want to use an external server because the app should run offline in an Ad-Hoc network.
First I thought of creating a local webserver on the iPad, but I couldn't find anything PhoneGap related. Any Idea?
You were probably on the right track with the web server idea.
I am not sure how well the various solutions are supported in PhoneGap, but I would think you could use some sort of WebSockets implementation for the bi-directional communication between the iPhone and iPad apps.

Resources