1
Hello,
I have 3 apps and each one is available for iOS and Android and would like to create an app to access all of them.
To achieve this, I need to take the code of each application and move it to a server so that this fourth application can redirect between apps.
It is important to mention that each application needs to access the phonegap native controls and as such needs to have imported the Cordova.js or phonegap.js file into the source code.
It turns out that when we compile an application that file is injected into the directory according to the platform for which we are compiling.
When moving applications to different servers some problems arise that are due to these simple functional requirements:
- Local application allows you to open remote applications
- Remote applications can access device controls and plugins installed on it
- From any remote application it should be possible to return to the local application
Problems: - My remote applications are hosted in their own domain such as a.com, b.com, c.com. All applications communicate with an api that is in the d.com. domain As the administrator cannot authorise CORS, when I open the application in Inappbrowser the applications cannot communicate with the API, because the domain of the application we are accessing is different from the domain of the api (ex: A.com != c.com logo => We have CORS). Typically, this problem does not exist if we take the code found in any of these applications: ("a.com"... "c.com") and compile it because the applications are no longer hosted on a server.
- Having said that, and without solving the problem of how to access the application controls, I came up with the idea of placing different versions of the application on the server where each of them hosts the phonegap.js file for the platform that made the request.
Example: When opening application 4 the application detects that we are using an android and will create dynamic links that allow me to the project that has in its directory phonegap.js for Androids.
in other words: a. com/android <----- has a phonegap.js for Androids a. com/Ios <---- has a phonegap.js for Ios
Even if this solution works I still don’t know how to get back the local application.
Does anyone have any ideas that could help solve these problems? I hope it wasn’t too confusing, the problem is complex
Thanks for the reply Enrique. I will carefully check your suggestions and return to give feedback
– Lothre1