Search code examples
iosobjective-ccocoahttpserver

Objective-C/CocoaHTTPServer - Is it possible to return response to the app?


I am developing an iPhone app which is using CocoaHTTPServer for making remote server communication.

The app will send the request details to the CocoaHTTPServer which will store the request locally. Once the internet connectivity is available, CocoaHTTPServer will send the request to remote server & will get the server response now CocoaHTTPServer has to send this response back to the app,

But I am confused how to implement it. Is there any inter app communication api for the same?

Any suggestions are greatly appreciated.


Solution

  • URL scheme can be used to send the response back to the app. The response from the remote server can be set as a parameter in the URL. The CocoaHTTPServer can invoke the other app which will be the handler of this unique URL. The below link provides more information on the same.

    Inter-AppCommunication using URL scheme