Reputation: 1322
I need to create a mobile app that contains other apps and can run them. It is basically like an "app center" which have a list of apps (that we publish on our server) and the user can open one of them which lead to the app being opened.
Think about Expo's app, the user can scan the QR code of his app and it will be automatically compiled and opened, this is close to the feature I want.
The apps that can be opened are created using react-native and stored inside GIT repositories in Gitlab.
Consider the following example:
By launching the app, which we call App Center, a list of apps will be shown. When the user click on one of them, it will be opened internally.
Here's a "more technical" example:
So according to you which is the best approach I should consider.
Should I use a remote code solution such as CodePush or react-native-dynamic-bundle ? Do they fit in this context ?
Upvotes: 10
Views: 3430
Reputation: 843
This is possible partially via CodePush:
However, the caveat might be a dealbreaker:
There is also a better way:
[{app:"A1", version: 2.0.0}, {app: "A2", version: 1.2.0}]
This is repeated whenever the central configuration changes (say after A1 publishes npm package they update the central configuration).
It solves the problem of restart as you've all bundles build in to one.
Or go you might want to through expo's code https://github.com/expo/expo/blob/d56076241cef55b0a93a5c0bb8dc690270e42dcb/home/screens/QRCodeScreen.android.js#L89
Upvotes: 4
Reputation: 3150
I only know 2 ways to do that but neither is exactly what you are asking for.
1 - Make all Apps in React Native and put all inside. Then, depending to the server, you will show X apps.
2 - Using Linking from React-Native. I have created an app that 1 of the features is to link it with another app I created. When I click the button it tries to open it if the app is installed in the device, else, the app store / google play will be opened showing the app to download.
That's the way to use Linking: https://facebook.github.io/react-native/docs/linking
I know that it isn't what you are asking for but I don't think that what you are asking would be possible at all.
Upvotes: 1