Overview

While you can configure your application’s functionality provided by the SDK, you can also extend the functionality of your mobile application with plugins you’ve already created.

We support plugins built in Flutter.


Android

The MXmobile SDK supports embedding modules using Option A — Depend on the Android Archive (AAR):

  1. In the root of the Flutter module, run flutter build aar --no-debug --no-profile.
  2. Add the following to proj.android/app/build.gradle:
build.gradle
1
2
3
4
5
6
7
8
9
String storageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
      repositories {
        maven {
            url '<path_to_local_maven_repository>'
        }
        maven {
            url "$storageUrl/download.flutter.io"
        }
      }
  1. Add the following to the dependencies section in the same build.gradle file:
build.gradle
1
releaseImplementation '<flutter_module_package_name_found_in_pubspec.yaml_(flutter.module.androidPackage)>:flutter:<module_version>:<release_or_debug>'
  1. Update the compileSdkVersion & targetSdkVersion from 30 to 31 in build.gradle.
  2. Add android:exported="true" to the <activity ...> and <receiver ...> tags.
  3. In conanfile.py, add mxflutter-Android/3.3.2-0@mx/stable to the requires list. This version may change over time, particularly the patch number. Contact MX for the correct version number.
  4. In institutions/mxmobile/config/configuration.yaml, set has_flutter_plugin to true.
  5. Run ./setup, then ./generate
  6. Contact MX to help launch your Flutter module from a custom tile, a money movement component, the Other Resources card on the dashboard panel, or the main menu.

iOS

The MXmobile SDK supports embedding modules using Option B - Embed frameworks in Xcode:

  1. In the root of your Flutter module, run flutter build ios-framework --no-debug --no-profile. You can also use ... --no-release --no-profile to build a debuggable/attachable Flutter engine, but note that debuggable flutter engines can only be run from Xcode.
  2. Navigate to <flutter_module_root>/build/ios/framework/Release/ or <flutter_module_root>/build/ios/framework/Debug/ if you intend to build a debuggable Flutter engine & module.
  3. Copy all xcframework files to the same folder as mxmobile.xcodeproj.
  4. Open mxmobile.xcodeproj in Xcode and go to the General tab for the MXmobile iOS target. Find the section labelled Frameworks, Libraries, and Embedded Content.
  5. Select +, then Add Other…. In the dropdown menu, select Add Files …. Select all xcframework files (including Flutter.xcframework), then select Open. Make sure all xcframework files have the Embed & Sign option except for FlutterPluginRegistrant.xcframework, as it is a static library that only needs to be linked against.
  6. If you intend to use flutter attach to attach to a debuggable Flutter engine, add the following to Info.plist:
Info.plist
1
2
3
4
<key>NSBonjourServices</key>
<array>
    <string>_dartobservatory._tcp</string>
</array>
  1. In institutions/mxmobile/config/configuration.yaml, set has_flutter_plugin to true.
  2. Run ./setup, then ./generate.
  3. Contact MX to help launch your Flutter module from a custom tile, a money movement component, the Other Resources card on the dashboard panel, or the main menu.