-
Notifications
You must be signed in to change notification settings - Fork 0
Flutter SDK Install
See the example to install the last version of the Screeb SDK dependency in a Flutter app.
The Screeb SDK is configured to work with Android SDK version 21 minimum and iOS version 12 minimum.
The size of the SDK is approximately 500 KB on Android and approximately 3.2 MB on iOS.
First, log in to the Screeb application, then create your first survey.
When your survey is ready to share, we will provide a Flutter snippet to copy in the onCreate()
function of the Application class.
# pubspec.yaml
dependencies:
plugin_screeb: x.x.x
Then:
flutter pub get
The Android SDK needs the permissions ACCESS_NETWORK_STATE
and INTERNET
to work well.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
You should use MultidexApplication to avoid compilation issues.
defaultConfig {
(...)
multiDexEnabled true
}
(...)
dependencies {
(...)
implementation 'androidx.multidex:multidex:2.0.1'
}
The Android SDK requires to be notified of activities lifecycle changes to be correctly started.
It is mandatory to pass the Application context to the module in your custom Application class in the onCreate
function:
override fun onCreate() {
super.onCreate()
PluginScreebPlugin.setAppContext(this)
}
Your android app needs to use AGP minimum 7.1.3.
classpath("com.android.tools.build:gradle:7.1.3")
Then you should set IOS target build configuration BUILD_LIBRARY_FOR_DISTRIBUTION
to YES
in your Podfile
to avoid runtime crash:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
When upgrading the Flutter SDK version, you may need to run in ios/
directory:
pod update Screeb
PluginScreeb.initSdk("<android-channel-id>", "<ios-channel-id>", null);