Hello,
I have 3 applications and each one is available for iOS and Android and I would like to create an app to access all of them.
In order to achieve this, I need to get the code from each of the applications 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 native controls of the phonegap and as such needs to have imported into the source code the file cordova.js or phonegap.js
It turns out that when we compile an application this file is injected into the directory according to the platform we are compiling for.
When moving the applications to different servers, some problems arise due to these simple functional requirements:
- Local application lets you open remote applications
- Remote applications can access the device controls and plugins installed
- From any remote application it should be possible to return to the local application
Problems: - My remote apps are hosted on your 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 can not authorize CORS, when I open the application in InAppBrowser the applications can not communicate with the API, because the domain of the application that we are accessing is different from the api domain (ex: A.com! = C.com logo = > We have CORS). Typically, this problem does not exist if we get 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 this, and without solving the problem of how to access the application controls I get the idea of putting different versions of the application on the server where each one of them makes the host of the file phonegap.js for the platform that did the order.
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 the 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 though this solution works, I'm still not sure how to get back to the local application.
Does anyone have ideas that can help solve these problems? I hope it was not too confusing, the problem is complex