What is a MiniApp
We made the choice to distinguish a MiniApp from a full-fledged React Native application considering that a MiniApp is not a complete application on its own, but rather a "mini" application that can be composed with other MiniApps to form parts of a mobile application.
- A MiniApp can be a single, simple UI component with minimal logic or it can be a single page application that includes business logic and can communicate with the native side.
- A MiniApp can be a multi-page application containing a complete application feature.
- A MiniApp can be shipped and updated inside a mobile application, either included as a native container for in-development mobile application version or as an Over The Air (OTA) update for released mobile application versions.
- A MiniApp can be headless, meaning that it can only contain business logic that is invoked by the mobile application through exposed Electrode Native API(s).
While your actual coding experience won't change, the CLI commands you'll interact with will be slightly different. Some of the commands from the React Native CLI have been replaced with a few Electrode Native CLI commands.
For example, instead of running the
react-native run-ioscommand to launch your React Native MiniApp inside an iOS simulator or real device, you will use the
Instead of using the
react-native startcommand, you'll use the
ern startcommand. Most of these commands will actually invoke the associated React Native commands, but the Electrode Native CLI commands perform additional platform-specific logic. Also, you won't have to use the React Native
react-native linkcommand due to the fact that supported native dependencies will be automatically linked.
Activitieson Android and
ViewControllerson iOS--and launch them when appropriate, based on your overall mobile application UX flow.
Interactions and communication between the MiniApps and your mobile application are conducted using APIs that are also part of your container. The APIs can be consumed in your mobile application in a way that is very intuitive and mobile-development friendly--while also leveraging a high degree of type-safety at compile time.
There are a few considerations and recommendations that you want to read about before using Electrode Native.
- Because your MiniApps will be integrated in a mobile application, the navigation flow needs to be natively handled. Every new MiniApp has a dependency on ern-navigation.
Third-party native modules