Skip to main content

Flutter SDK Setup

To integrate AppsOnAir AppRemark Flutter SDK into your Flutter Apps, follow the below steps

Essential Setup
  • Make sure to configure the App ID properly. For additional information Getting started

iOS Requirements and Setup​

Requirements​​

  • Minimum deployment target: 15.0

  • Add the following photo library permission to your Info.plist:

info.plist
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) need permission to choose image from gallery for App Remark feature.</string>

iOS Dependency Manager​

This plugin supports both CocoaPods and Swift Package Manager (SPM). SPM requires Flutter 3.24.0 or higher.

Enable SPM globally (once per machine):

flutter config --enable-swift-package-manager

Then run:

flutter pub get

Flutter automatically resolves the native iOS dependency via SPM — no additional Xcode configuration needed.

tip

You can also enable SPM per project by adding to pubspec.yaml:

flutter:
config:
enable-swift-package-manager: true

Android Requirements​ and Setup​

Requirements​​

  • JAVA 11 required

  • An Android 7.0+ device or emulator.

  • Project using AndroidX.

  • compileSDKVersion set to 34 or higher.

  • Targets API level 24 (NOUGAT) or higher

  • Android Gradle Plugin (AGP): Version 8.0.2 or higher

  • Gradle version 8.0 or higher

  • Kotlin Version 1.7.10 or higher

  • Uses Jetpack (AndroidX), which includes meeting these version requirements:

    • compileSdkVersion 34 or later
  • Set up a physical device or use an emulator to run your app.

  • Create or login to your AppsOnAir Account

  • Go to the Keys & IDs tab under App Settings, copy and use the App ID in your SDK integration.

Setup​

Add AppsOnAir AppRemark in Gradle Plugin​

  • In settings.gradle:
setting.gradle
pluginManagement {
……
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url 'https://jitpack.io' }
}
}
  • In root level build.gradle:
build.gradle
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Newer versions of Android Studio

When creating a new project from Android Studio Arctic Fox (or newer) the allprojects{...} is no longer added in the project level gradle. Add JitPack under dependencyResolutionManagement in settings.gradle instead:

settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
gradle.properties
android.useAndroidX = true
android.enableJetifier = true

Add the below code to your Launcher activity​

  • Add the following code because Flutter is preventing the SDK from capturing the current screen.
MainActivity
import io.flutter.embedding.android.RenderMode
class MainActivity : FlutterActivity(){
override fun getRenderMode(): RenderMode {
return RenderMode.texture
}
}

Create strings.xml​

  • Create a string.xml file in android/app/src/main/res/values and add the below code.
string.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name"> YOUR_APP_NAME </string>
</resources>

Add the AppRemark Service in Flutter code​

Add the SDK​

  • Run the following command to add the package:
pubspec.yaml
 $ flutter pub add appsonair_flutter_appremark

Import the SDK​

Import
import "package:appsonair_flutter_appremark/app_remark_service.dart";

Initialize the Service​

Here’s how to initialize the service:

@override
void initState() {
super.initState();
AppRemarkService.initialize(
context,
shakeGestureEnable: true, // Set to true or false as per your need
shakeSensitivity: ShakeSensitivity.medium, // Optional — defaults to medium
onRemarkResponse: (result) {
// Handle Response Here
},
);
}
  • Initialize the AppRemarkService with default Add Remark screen.
  • The AppRemarkService initialization allows you to integrate remark functionality. By default, the shake gesture is enabled shakeGestureEnable: true, allowing the device to capture the current screen on a shake. To disable this behavior, you can explicitly set shakeGestureEnable to false.
  • The shakeSensitivity parameter controls how much force is required to trigger the shake gesture. If not set, it defaults to ShakeSensitivity.medium.
  • The onRemarkResponse method listens for the feedback status when feedback is submitted, such as success or failure responses.

shakeSensitivity values​

ValueDescription
ShakeSensitivity.veryLowVery hard, deliberate shake required
ShakeSensitivity.lowFirm shake required
ShakeSensitivity.mediumNormal shake (default)
ShakeSensitivity.highLight shake triggers feedback
ShakeSensitivity.veryHighAny motion triggers feedback

onRemarkResponse listener response​

{
"message": "Remark added successfully.",
"status": "SUCCESS"
}
FieldTypeDescriptionExample
messagestringA descriptive message providing details about the feedback submission status."Remark added successfully."
status"SUCCESS" | "FAILURE"Indicates whether the feedback submission succeeded or failed in the onRemarkResponse listener."SUCCESS"

Customization and Usage​

Customize the Add Remark Screen​

  • Customize the Add Remark screen theme according to your app theme by passing an options map containing key-value pairs.
  • Available keys of options for Customization
KeyDataTypeValueDescription
pageBackgroundColorString"#E8F1FF"Set page background color
appBarBackgroundColorString"#E8F1FF"Set appbar background color
appBarTitleTextString"Add Remark"Set appbar title text
appBarTitleColorString"#000000"Set appbar title color
remarkTypeLabelTextString"Remark Type"Set remark type label text
descriptionLabelTextString"Description"Set description label text
descriptionHintTextString"Add description here..."Set description hint text
descriptionMaxLengthint255Set description max length
buttonTextString"Submit"Set button text
buttonTextColorString"#FFFFFF"Set button text color
buttonBackgroundColorString"#007AFF"Set button background color
labelColorString"#000000"Set text field label color
hintColorString"#B1B1B3"Set text field hint color
inputTextColorString"#000000"Set text field input text color
example
AppRemarkService.initialize(
context,
options: {
'pageBackgroundColor': '#FFC0CB',
'descriptionMaxLength': 25,
},
onRemarkResponse: (result) {
// Handle Response Here
},
);

Open the AppRemark Screen Manually​

await AppRemarkService.addRemark(context);
  • Use the addRemark method to open the Add Remark screen manually:

Send Custom Payload​

await AppRemarkService.setAdditionalMetaData(extraPayload: {
"userName": "USER_NAME",
"userId": "USER_ID",
"openUsingShake": "false",
});
  • Send additional meta-data by using setAdditionalMetaData method and pass extraPayload as a map with key-value pairs:
Initialization

Make sure that to call initialize() method after MaterialApp!

Run App & Verify AppRemark Services​

Run your app by using code editor on Android/IOS simulators or any physical device to make sure it builds correctly.

note
All submitted screenshots and feedback will be displayed on a web portal.

For more details explore the example​