How develop modular flutter app to install or uninstall within the app itself - dart

We are developing an app with flutter framework. Want to know how can we achieve the following functionality.
Base app will have minimal features
App should list the available modules to add to the existing app.
User should be able to add these (either with in-app purchasing or free)
User should also be able to disable/uninstall these modules.
I read about packages and plugins. I felt that they are to be included at development time in pubspec.yaml. But I want to add these modules from an installed app at runtime.

What I can think off right now is to use Android AIDL to create an assistant apk. Then you can sell it on the App Store.
A short tutorial is available here.

Related

dart/flutter: How to ship iOS apps using flutter frontend vs. C/C++ backend to App Store?

Goal
I'm building an iOS app using flutter for frontend, and C/C++ as backend. They must interoperate through FFI, which is a language binding scheme through C dynamic libraries. I intend to submit it to iOS App Store.
Problems
The Dart FFI sample on accessing C-struct works on macOS through dynamic liking and binding. Now dynamic linking is technically possible on iOS according to Xcode 9 - No option to create dylib project iOS, however, it's unclear to me how to ship the app to AppStore, because dynamic linking is not allowed according to Apple Guidelines Section 2.5.2.
2.5.2 Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they
download, install, or execute code which introduces or changes
features or functionality of the app, including other apps.
Educational apps designed to teach, develop, or allow students to test
executable code may, in limited circumstances, download code provided
that such code is not used for other purposes. Such apps must make the
source code provided by the Application completely viewable and
editable by the user.
Quite a few SO questions confirm this problem, such as:
can I use dynamic library(shared object) in my iphone app?
Will Appstore reviewers allow us to use dynamic library in iOS8?
Then official flutter documentation says
Dynamically linked libraries are automatically loaded by the dynamic
linker when the app starts. Their constituent symbols can be resolved
using DynamicLibrary.process. You can also get a handle to the library
with DynamicLibrary.open to restrict the scope of symbol resolution,
but it’s unclear how Apple’s review process handles this.
Questions
As of the date when I post this (2020), does this say that I could never ship an app using this architecture to App Store?
Is it possible that I static link my C/C++ code into a single binary of a flutter app? Take Unity as an example, their iOS plugin system recompiles the plugin into native app. If flutter has a similar mechanism, how?
The answers saying you can't use dynamic libraries on iOS date to before iOS 8, when support for user-provided dynamic libraries was added.
Nothing in 2.5.2 days you can't use dynamic libraires as long as they are shipped as part of your app. So:
As of the date when I post this (2020), does this say that I could never ship an app using this architecture to App Store?
No it doesn't, as long as "this architecture" refers to using a dynamic library that you link to at build time and bundle into your application.
Adding inputs from Reddit's FlutterDev channel
#escamoteur
As I understand it you are not allowed to load any library from
outside your installation folder. Especially not downloading something
at a later point of time. Could you make this a Stackoverflow question
and tag it with Flutter?
#airflow_matt
Since iOS 8 there can be shared libraries in the bundle, when properly
codesigned I don't see why dlopen wouldn't work. Or you can link the
library with main executable itself (just like flutter does) and
dlopen self (DynamicLibrary.process()). I think it's worth a shot.

How to update user iOS app with Apple Enterprise account

I have an Enterprise Apple Account. I want to update the user app without any notification.
Let me explain my requirement -
I have one iOS native app (Say app1). I have my own cocoa-pods library (Say lib1). I have integrated my own cocoa-pods library lib1 to native app app1. there is no issue. I have integrated and know the basic procedure to integrate this.
Now my requirement is that if I change something in my cocoa-pod library lib1, then it should be automatically reflect to Native iOS app app1 without sharing new build with users.
I don't want to run the command pod install or pod update and then share new ipa with users or enterprise link.

How to test the "open-in-app" feature for the branch link created using Branch.io in development build?

I have an application which is already in App Store.I have to check the branch linking feature I added using Branch.io in development build.That is, when a user shares something on social networks, clicking on the shared post should open the application installed. So how do I check this functionality in development build?
Alex from Branch.io here: Branch doesn't know (or care) how the application is installed onto your device. Installing directly from Xcode and using a beta distribution system (TestFlight, Hockey, Fabric, etc.) are treated exactly the same way as going through the App Store.
Here is a flow you can use to test this:
Install a build of your app that includes the Branch SDK
Generate a link and post it somewhere like iOS Notes
Uninstall your app
Open the link and let it redirect all the way through to the App Store page
Close the App Store
Install a build of your app locally (using either Xcode or TestFlight/Fabric/etc.)
Open your app
The link data will be returned to you, exactly the same way it would be when your app is installed from the App Store by a user.

Is it possible to create a IOS app that can download plugins and extension later?

we have a ios app that provides the platform for many similar games. When you install this app. This app already contains binaries of x number of games.
Now we are having size issue. So just wanted to know is it possible to create a ios app that can get installed and after that as per user selection can download the games binaries separately and then run. Like a app that can download games as plugins or extensions.
I work on game side part so i dont know anything about ios apps. but so far my understanding is -> when you create the ios executable then while compiling you should have all the code present (app + all the games it will run).
It is not possible to download a native executable and run it -- that is not a capability provided by app extensions.
One loophole you might consider: it is perfectly permissible to download and run javascript, or anything else that runs in a UIWebView or WKWebView, which are both sandboxed from your iOS App's process, and have access to OpenGLES 2.0 in the form of WebGL. There are also apps which have been accepted in the App Store which can run code in interpreted languages like Python.

how to add one or more plugins to an existing app

My company want to make an application which like a bookshelf can load more books when the application finished, they want the application to be able to load more plugins without destroying the already installed code: when the app has been purchased and downloaded from the app store, the user can buy plugins in the app store and install them into the app.
Can anyone tell me how this could be achieved? Thank you very much.
Implementing A Plugin System in C or C++
Xcode & iOS - Create Plugins?
How can I combine multiple iPhone applications in to one application?
Objective-C Plugin Architecture Security (Mac, not iPhone)
Objective-C and designing a plugin mechanism
https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFPlugIns/CFPlugIns.html
You have to choose right platform for creating plugins and then you need to link installed plugins to correct app
I don't think you'll be able to check that before installing plugins the app has to be installed
Second way will be using in-app purchase and downloading plugins to program data directory
I think the second way is more usable and more valid, because in AppStore cannot be sold application which is not standalone, and depends on another app.

Resources