Search code examples
androidiosionic-frameworkcapacitor

Cross Platform App framework allowing Webviews and Native Views


We are currently evaluating how we can bring our existing web application to mobile devices. While 95% of our existing features work just fine in our existing web application, we need to launch a native view for a small portion of the functionality. The native view needs to run native as we need to include a native dependency that requires quite a few resources.

We are currently researching what possible frameworks or solutions offer this and how this can be done. So far we had a look at capacitorjs. Our web application works reasonably well with capacitor out of the box, but I couldn't find out how to launch native activities from capacitor, it seems to support running native code easily enough, but the view remains on the webview. We have found Ionic Portals, which seems to be still quite new, but not much else.

I am sure we are not the only ones that face these challenges. Are there any good options for this usecase?


Solution

  • In capacitor you can present native views using plugins. Plugin classes have access to the view controller and with it you can in example present a modal of the native view in the case of iOS or launch intents to other native activities or fragments in the case of android.

    Portals is the opposite, it allows to use webViews inside native apps. If you already have a native app but also have web code you can mix both easily.