The Mobile Protect SDK has a dedicated integration for iOS and Android apps built using Flutter. This document will take you through the steps to integrate the SDK into your build system.
This will involve some steps on the Flutter side as well as some steps on both iOS and Android.
Flutter Integration
Add mobile_protect
as a dependency in your pubspec.yaml file.
$ flutter pub add mobile_protect
The project’s pubspec.yaml
should then contain the following entry:
dependencies: mobile_protect: ^22.3.7
See https://dart.dev/tools/pub/versioning for deciding if pinning the versions is the best practice for your project.
Android Integration
Follow the steps on Mobile Protect SDK for Android via Maven
In the Android project, create the
xml
directory (flutter_app/android/app/src/main/res/xml
) if it does not exist. Then, copy themobileprotect.xml
config file into thexml
resources folder.
iOS Integration
Follow step 1 on Mobile Protect SDK for iOS via CocoaPods (cocoapods.org)
In the iOS project copy the
MobileProtect.plist
config file into the Flutter project's Xcode project, place it in the project root. See Add Existing Files and Folders to a Project for instructions.