Replies: 2 comments 2 replies
-
The embedded use case is for adding web apps as screens (or part of screens) on existing native apps. But they should be functional apps. What you want to do it's also technically possible, but not really recommended, in example, for showing an Ionic button in your native app you would be creating a web app that just shows a button, and then show a native WebView with the size of the button that displays it. And same for every Ionic component you want to use. |
Beta Was this translation helpful? Give feedback.
-
I think I figured it out. At first I was trying to add the android-studio generated by Ionic to my dependencies, but problem with this is that you can only add one project since the names of the generated files are always the same. In fact you just have to:
If you have multiple projects, you can copy www/ to a subfolder of assets/public/app1 and instantiate as BridgeFragment.newInstance("public/app1"). But you always have keep a copy of www/ in assets/public/ since that's where capacitor looks for some files like 'native-bridge.js' (and probably others?). I still get this error: E/Capacitor: Unable to load capacitor.config.json. Run npx cap copy first. Not sure if this will give problems? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to figure out if it is possible to create some UI-components with Ionic and the use these components in my existing Android and iOS apps. This would be a great way to start using Ionic without having to rewrite the entire app.
I found this post by Max Lynch about Capacitor where he briefly mentiones "native apps embedding mini hybrid apps".
https://tinyletter.com/ionic-max/letters/how-capacitor-works
This sounds exactly like what I'm looking for, but I can't find any more guidance on how to achieve this. I have the following questions:
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions